nobaloney
NoBaloney Internet Svcs - In Memoriam †
My thanks to Onno, who wrote this; all I did was successfully use it.
How to fix mysql when a MySQL update causes users to no longer be able to create databases in DirectAdmin:
Log into DirectAdmin as Admin
Go to the Service Monitor
Stop mysqld
Log into the server using SSH as root
# mysqld_safe --skip-grant-tables &
If you don't get back to the prompt hit enter (mysql will still be running)
# mysql_fix_privilege_tables --user=root --verbose
# killall -9 mysqld_safe; killall -9 mysqld
# mysqld_safe --skip-grant-tables &
If you don't get back to the prompt hit enter (mysql will still be running)
# mysql -uroot
mysql> use mysql
mysql> UPDATE user SET password=PASSWORD('newrootpassword') WHERE user='root';
mysql> GRANT ALL PRIVILEGES ON *.* TO da_admin@localhost IDENTIFIED BY 'newda_adminpassword' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;
mysql> quit
# killall -9 mysqld_safe; killall -9 mysqld
# service mysqld start
Now try to log into mysql with the new passwords
# mysql -uroot -p
Enter password: <enter newrootpassword here>
mysql> quit
# mysql -da_admin -p
Enter password: <enter newda_adminpassword here>
mysql> quit
# vi /usr/local/directadmin/conf/mysql.conf
Find the line passwd=<oldda_adminpassword>
and change to passwd=<newda_adminpassword>
Log into DirectAdmin as Admin
Go to the Service Monitor
Start mysqld
Note that you can use the old passwords as your new passwords if you wish. Note also that you can replace vi with any editor of your choice.
Jeff
How to fix mysql when a MySQL update causes users to no longer be able to create databases in DirectAdmin:
Log into DirectAdmin as Admin
Go to the Service Monitor
Stop mysqld
Log into the server using SSH as root
# mysqld_safe --skip-grant-tables &
If you don't get back to the prompt hit enter (mysql will still be running)
# mysql_fix_privilege_tables --user=root --verbose
# killall -9 mysqld_safe; killall -9 mysqld
# mysqld_safe --skip-grant-tables &
If you don't get back to the prompt hit enter (mysql will still be running)
# mysql -uroot
mysql> use mysql
mysql> UPDATE user SET password=PASSWORD('newrootpassword') WHERE user='root';
mysql> GRANT ALL PRIVILEGES ON *.* TO da_admin@localhost IDENTIFIED BY 'newda_adminpassword' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;
mysql> quit
# killall -9 mysqld_safe; killall -9 mysqld
# service mysqld start
Now try to log into mysql with the new passwords
# mysql -uroot -p
Enter password: <enter newrootpassword here>
mysql> quit
# mysql -da_admin -p
Enter password: <enter newda_adminpassword here>
mysql> quit
# vi /usr/local/directadmin/conf/mysql.conf
Find the line passwd=<oldda_adminpassword>
and change to passwd=<newda_adminpassword>
Log into DirectAdmin as Admin
Go to the Service Monitor
Start mysqld
Note that you can use the old passwords as your new passwords if you wish. Note also that you can replace vi with any editor of your choice.
Jeff