Rectangle 27 0

mysql 1045 Access denied for user after executing query?


$ /etc/init.d/mysql restart
$ mysql -u root mysql

$mysql> UPDATE user SET Password=PASSWORD('my_password') where USER='root';
$mysql> FLUSH PRIVILEGES;
$ mysqld --skip-grant-tables
update user set authentication_string=password('my_password') where user='root';

Finally, restart the instance/daemon without the --skip-grant-tables option.

If you face the unknown field Password error above use:

Not working,even not able to execute $ mysqld --skip-grant-tables

Start the MySQL server instance or daemon with the --skip-grant-tables option (security setting).

Note