Last active
October 14, 2015 21:36
-
-
Save javathought/2fb7913e21faa8c340a1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/init.d/mysql stop | |
Shutting down MySQL.. | |
# mysqld_safe --skip-grant-tables --skip-networking & | |
[1] 4983 | |
# Starting mysqld daemon with databases from /var/lib/mysql | |
# mysql mysql | |
Welcome to the MySQL monitor. Commands end with ; or \g. | |
Your MySQL connection id is 1 to server version: 5.0.21-log | |
Type 'help;' or '\h' for help. Type '\c' to clear the buffer. | |
mysql> update user set password=password('aaaaaaaa') where user="root" and host="localhost"; | |
Query OK, 0 rows affected (0,00 sec) | |
Rows matched: 1 Changed: 0 Warnings: 0 | |
mysql> exit | |
Bye | |
# mysqladmin shutdown | |
STOPPING server from pid file /var/lib/mysql/debian.pid | |
030811 14:38:40 mysqld ended | |
[1]+ Done /usr/local/mysql/bin/mysqld_safe --skip-grant-tables --skip-networking | |
# /etc/init.d/mysql start | |
Starting MySQL | |
# mysql -u root -p | |
==================================================================================================== | |
If the GRANT ALL doesn't work, try: | |
Stop mysqld and restart it with the --skip-grant-tables option. | |
Connect to the mysqld server with just: mysql (i.e. no -p option, and username may not be required). | |
Issue the following commands in the mysql client: | |
UPDATE mysql.user SET Grant_priv='Y', Super_priv='Y' WHERE User='root'; | |
FLUSH PRIVILEGES; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment