Changing the root password on MySQL

[root@host ~]# mysql -u root mysql
ERROR 1045: Access denied for user: ‘root@localhost’ (Using password: NO)
[root@host ~]#mysql -u root -p mysql
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 3 to server version: 3.23.47
Type ‘help;’ or ‘h’ for help. Type ‘c’ to clear the buffer.
mysql> SET PASSWORD FOR root@localhost=PASSWORD(‘newpasswod’);
Query OK, 0 rows affected (0.06 sec)

Leave a comment

Your comment