1

Ok, so I changed my password through phpMyAdmin and it's completely locked out my access to the root mysql user. There are various articles about this online, but none of them seem to work. Here's what i've tried so far:

Stop the mysql service: sudo /etc/init.d/mysql stop

Start with this option: sudo mysqld --skip-grant-tables &

Start mysql prompt: mysql

Enter following at mysql prompt:

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

This is all working fine, but I cannot connect using the new password, i'm not sure exactly what the problem is.

Any help is much appreciated.

Tom

3 Answers3

2

Could be because your account on MYSQL could be more than one.

For example root, root@localhost and root@xxx.xxx.xxx.xxx.

So First check the user accounts on the server:

select User from mysql.user where mysql.user like '%root%';

Then Update the password accordingly.

Alternatively, you can also use mysqladmin to change password, which I have found to be a better solution.

1

You should be using the SET PASSWORD syntax detailed here.

SET PASSWORD FOR 'user'@'host' = PASSWORD('newpassword');
sinping
  • 2,090
  • 14
  • 13
0

If you're still trying to connect with phpMyAdmin, delete your browser cache and cookies.OR, after failed login using the right credentials, press ctrl+f5, in order to reload and override the cache

DimitrisD
  • 241