Reset mysql root password

Steps to reset the mysql root password

Step # 1 : Stop mysql service

# /etc/init.d/mysql stop

Step # 2: Start to MySQL server w/o password:

# mysqld_safe –skip-grant-tables

Step # 3: Connect to mysql server using mysql client:

# mysql -u root

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 1 to server version: 4.1.15-Debian_1-log

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql>

Step # 4: Setup new MySQL root user password

mysql> use mysql;
mysql> update user set password=PASSWORD(“NEW-ROOT-PASSWORD”) where User=’root’;
mysql> flush privileges;
mysql> quit

Step # 5: Stop MySQL Server:

# /etc/init.d/mysql stop

Step # 6: Start MySQL server and test it

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

 

Related Posts

  • 53
    it is quiet easy to reset mysql root password, here are the steps SSH as root to your machine Turn off the mysqld daemon if running RedHat/Fedora users can do so by executing:  service mysqld stop Run safe_mysqld by executing:        safe_mysqld –skip-grant-tables (this will run allow you to…
    Tags: mysql, password, root, reset, connect, service, start
  • 42
    I tried the following steps: Log in as super user or use sudo Open /etc/mysql/my.cnf using gedit Check the all the configuration Find bind-address, and change its value to the database server host machine's IP address. For me, it was localhost or 127.0.0.1 Save and close the file. Come back…
    Tags: mysql, server, start, service, steps, connect
  • 37
    Error: 1045 SQLSTATE: 28000 (ER_ACCESS_DENIED_ERROR) Message: Access denied for user '%s'@'%s' (using password: %s) This occurs when the user has no access to database server and user is trying to connect the database server. Suggestions:  Check the mysql user rights Check the database access rights Check the users IP
    Tags: server, mysql, password, connect, root
  • 34
    90% of the time, this error is due either to the MySQL Server not running, or else firewall configuration on the Windows server blocking access on port 3306 (or whatever port your MySQL instance is configured to use). Error: 2003 (CR_CONN_HOST_ERROR) Message: Can't connect to MySQL server on '%s' (%d)
    Tags: mysql, server, connect
  • 32
    MySQL stores accounts in the user table of the mysql system database. An account is defined in terms of a user name and the client host or hosts from which the user can connect to the server. The account may also have a password. There are several distinctions between the…
    Tags: mysql, password, server, connect

Satya Prakash

VOIP Expert: More than 8 years of experience in Asterisk Development and Call Center operation Management. Unique Combination of Skill Set as IT, Analytics and operation management.

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: