blog.up-link.ro android bsd linux unix & open-source world

24Mar/100

How To Reset MySQL Password

WP Greet Box icon
Hello there! If you are new here, you might want to subscribe to the RSS feed or subscribe via E-mail for updates on this topic.

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

Print This Post Print This Post
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


*

No trackbacks yet.