You can reset your MySQL root password if you forget that or you are having any issue related to that.


1. First of all, log into the server as root using SSH.

2. Now, stop MySQL service:

# /etc/init.d/mysql stop

3. Start MySQL server without password:

# mysqld_safe --skip-grant-tables &

4. Connect to MySQL:

# mysql -u root

5. Setup new MySQL root password:

mysql> update user set password=PASSWORD("newpassword") where User='root';
mysql> flush privileges;
mysql> quit

6. Stop MySQL Server:

# /etc/init.d/mysql stop

7. Stop and start the MySQL service and test it:

# /etc/init.d/mysql stop
# /etc/init.d/mysql start
# mysql -u root -p

 

آیا این پاسخ به شما کمک کرد؟ 0 کاربر این را مفید یافتند (0 نظرات)