Change website

From Jan 16 2015,


All post content will be move to we's offical website with many content...

Can access website here: http://justox.com

Thanks for your visit!

Thursday, 19 December 2013

How To Reset MySQL password

1. Stop MySQL server
# /usr/local/etc/rc.d/mysql-server stop
2. Start MySQL server  with skip grant table mode
# mysqld_safe –skip-grant-tables &
Output:

[1] 5187
# Starting mysqld daemon with databases from /var/db/mysql

3. Login as user root without password
# mysql -u root -p

Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
mysql>

4. Set up the new root password

mysql> update user set password=password(’newpassword’) where user=’root’;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
5. Stop MySQL server
# /usr/local/etc/rc.d/mysql-server stop
6. Start MySQL server
# /usr/local/etc/rc.d/mysql-server start

No comments:

Post a Comment