1

I'm currently running WAMP under Windows 7, I changed my username and password for phpmyadmin.

I cant get my Mysql console working after changing password in phpmyadmin

After the change I get:

access denied for user 'root'@'localhost' (using password yes)

I have tryed to navigate to the mysql folder manual and tryed:

mysql -u username password newpassword

This with no luck of entering the comand line.

Anyone have an good awnser to actually set new password for the command line?

Michele La Ferla
  • 6,775
  • 11
  • 53
  • 79
sdfgg45
  • 1,232
  • 4
  • 22
  • 42
  • Possible help: http://dev.mysql.com/doc/refman/5.6/en/resetting-permissions.html – ʰᵈˑ Sep 22 '14 at 10:21
  • After flushing the cache -- UPDATE mysql.user SET Password=PASSWORD('YourNewPass') WHERE User='root'; FLUSH PRIVILEGES; -- You might need to change the password in PHPMyAdmin config file also. https://stackoverflow.com/a/31381342/3367835 – Razaman May 04 '19 at 13:52

4 Answers4

2

enter image description here
wamp server mysql user id and password

Images Also Available
Hit enter as there is no password. Enter the following commands:

[mysql> SET PASSWORD for 'root'@'localhost' = password('enteryourpassword');
mysql> SET PASSWORD for 'root'@'127.0.0.1' = password('enteryourpassword');
mysql> SET PASSWORD for 'root'@'::1' = password('enteryourpassword');][2]

That’s it, I keep the passwords the same to keep things simple. If you want to check the user’s table to see that the info has been updated just enter the additional commands as shown below. This is a good option to check that you have indeed entered the same password for all hosts.

enter image description here

Community
  • 1
  • 1
Darkcoder
  • 802
  • 1
  • 9
  • 17
1

This is a straight copy/paste from the manual.

  • Log on to your system as Administrator.
  • Stop the MySQL server if it is running.
  • Create a text file containing the following statements. Replace the password with the password that you want to use.

    UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root'; FLUSH PRIVILEGES;

  • Save the file. For this example, the file will be named C:\mysql-init.txt.

  • Open a console window to get to the command prompt: run cmd
  • Start the MySQL server with the special --init-file option (notice that the backslash in the option value is doubled):

    C:> C:\mysql\bin\mysqld --init-file=C:\mysql-init.txt

  • After the server has started successfully, delete C:\mysql-init.txt.

ʰᵈˑ
  • 11,279
  • 3
  • 26
  • 49
1

Alternatively to your solution you could click the Wamp icon near the clock, Mysql -> service -> remove service, then Mysql -> service -> install service and after this restart all services.

Philipos D.
  • 2,036
  • 1
  • 26
  • 33
-1

In WAMP server 3 you might need to change the query to

UPDATE mysql.user
  SET authentication_string =PASSWORD('MyNewPass')
  WHERE User='root';
FLUSH PRIVILEGES;
maxhb
  • 8,554
  • 9
  • 29
  • 53