Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resetting MySQL Root Password with XAMPP on Localhost

Tags:

php

So for the past hour I've been trying to figure out how to reset my 'root' password for MySQL as I cannot log into PHPMyAdmin. I've tried changing the password in the config.inc.php file and searching through other methods. I cannot find a successful way. A few months ago I changed it as a test password but now I forget what it was. If anyone can help, that would be great. (I'm running on a Windows computer).

like image 612
Codeeeeee Avatar asked Jul 04 '14 03:07

Codeeeeee


People also ask

How can I change MySQL root password in XAMPP?

To get started, launch your XAMPP Control Panel and click on the Shell button on the right-hand side. Use the XAMPP shell to change your root password. The shell will prompt you to enter a new password. Press Enter/Return again, and you'll be asked to confirm the new password.

How do I reset my localhost MySQL password?

In the mysql client, tell the server to reload the grant tables so that account-management statements work: mysql> FLUSH PRIVILEGES; Then change the 'root'@'localhost' account password. Replace the password with the password that you want to use.

How set MySQL root password localhost?

Configuring a default root password for MySQL/MariaDB Use the following procedure to set a root password. To change the root password, type the following at the MySQL/MariaDB command prompt: ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyN3wP4ssw0rd'; flush privileges; exit; Store the new password in a secure location.

How do I recover MySQL root password?

In order to recover the password, you simply have to follow these steps: Stop the MySQL server process with the command sudo service mysql stop. Start the MySQL server with the command sudo mysqld_safe –skip-grant-tables –skip-networking & Connect to the MySQL server as the root user with the command mysql -u root.


2 Answers

You want to edit this file: "\xampp\phpMyAdmin\config.inc.php"

change this line:

$cfg['Servers'][$i]['password'] = 'WhateverPassword'; 

to whatever your password is. If you don't remember your password, then run this command within the Shell:

mysqladmin.exe -u root password WhateverPassword 

where WhateverPassword is your new password.

like image 106
user3800108 Avatar answered Oct 07 '22 09:10

user3800108


Steps:

  1. Open your phpMyadmin dashboard
  2. go to user accounts
  3. on the user section Get the root user and click [ Edit privileges ]
  4. in the top section you will find change password button [ click on it ]
  5. make a good pass and fill 2 pass field .
  6. now hit the Go button.

7 . now open your xampp dir ( c:/xampp ) --> 8 . to phpMyadmin dir [C:\xampp\phpMyAdmin]

  1. open [ config.inc.php ] file with any text editor

10 .find [ $cfg['Servers'][$i]['auth_type'] = 'config'; ]line and replace 'config' to ‘cookie’

  1. go to [ $cfg['Servers'][$i]['AllowNoPassword'] = true; ] this line change ‘true’ to ‘false’.

last : save the file .

here is a video link in case you want to see it in Action [ click Here ]

like image 24
insCode Avatar answered Oct 07 '22 10:10

insCode