MySQL tips
Please see the MySQL documentation of version 3.23.39 for more information.
Section and page numbers used below refer to the PDF format of the MySQL manual.
shell> indicates commands to be executed from the directory where MySQL is installed.
mysql> indicates commands to be executed while connected to the server.
Bringing up the server
use the safe_mysqld command to bring up the server
shell> bin/safe_mysqld -u root &
September 14th, 2004 at 7:30 am
To change your password:
mysql> SET PASSWORD FOR user@localhost IDENTIFIED BY PASSWORD(‘new_password’);
The reason this does not work for you is because you should not be using the PASSWORD() function here. Should be "IDENTIFIED BY ‘new_password’;"
mysql> UPDATE user SET PASSWORD=PASSWORD(‘new_password’) WHERE User=’user_name’;
To remove a user:
mysql> USE mysql;
mysql> DELETE FROM user WHERE User=’user_name’;
Anytime you directly update the mysql authentication data using INSERT, DELETE, UPDATE, you need to run the "FLUSH PRIVILEGES;" command to make the changes take effect (also you can restart the server). GRANT and friends automatically do this.