Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- service mysqld stop
- service mysqld start --skip-grant-tables &
- mysql -u root
- Access denied for user 'root'@'localhost' (using password: NO)
- mysqladmin -u root password 'newpw'
- UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
- ERROR 1142 (42000): UPDATE command denied to user ''@'localhost' for table 'user'
- Stop the mysql demon process using this command :
- sudo /etc/init.d/mysql stop
- Start the mysqld demon process using the --skip-grant-tables option with this command
- sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &
- start the mysql client process using this command
- mysql -u root
- from the mysql prompt execute this command to be able to change any password
- FLUSH PRIVILEGES;
- Then reset/update your password
- SET PASSWORD FOR root@'localhost' = PASSWORD('password');
- If you have a mysql root account that can connect from everywhere, you should also do:
- UPDATE mysql.user SET Password=PASSWORD('newpwd') WHERE User='root';
- Alternate Method:
- USE mysql
- UPDATE user SET Password = PASSWORD('newpwd')
- WHERE Host = 'localhost' AND User = 'root';
- And if you have a root account that can access from everywhere:
- USE mysql
- UPDATE user SET Password = PASSWORD('newpwd')
- WHERE Host = '%' AND User = 'root';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement