Kill mysqld and start it with: su /etc/init. The server executes the contents of the file named by the -init-file option at startup, changing the account password.Īfter the server has started successfully, delete /home/me/mysql-init. Start the MySQL server with the special -init-file option: shell> /usr/sbin/mysqld -init-file=/home/me/mysql-init & How to recover mysql password duplicate Ask Question Asked 7 years, 9 months ago Modified 7 years, 9 months ago Viewed 14k times 3 This question already has answers here : How to change root password for mysql and phpmyadmin (3 answers) Closed 4 years ago. I tried sudo /etc/init.d/mysql stop sudo /usr/sbin/mysqld -skip-grant-tables -skip-networking & sudo mysql -u root Resulted in ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) I then tried the procedure outlined here. If you are not logged in as mysql (the user the server runs as), make sure that the file has permissions that permit mysql to read it. Nothing I enter for the root password works. To change the password for a root account with a different host name part, modify the instructions to use that host name. Although you can log in as root, once you start the MySQL server, make sure you start it with the -usermysql option. On Windows, use the following procedure to reset the password for the MySQL 'root''localhost' account. ![]() ![]() The file contains the password, so do not save it where it can be read by other users. Step 1: Log in as the MySQL User When you boot into your Linux installation, make sure you’re logged in as the same user that normally runs MySQL. This example names the file /home/me/mysql-init. SET PASSWORD FOR = PASSWORD('MyNewPass') Replace the password with the password that you want to use. Follow the below command to do the above steps. You did that with: su /etc/init.d/mysql stopĬreate a text file containing the following statement on a single line. Start MySQL server in safe mode with -skip-grant-tables options so that it will not ask for a password. Log on to your system as the Unix user that the MySQL server runs as (for example, mysql).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |