Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reset the privilege settings of the databases

Status
Not open for further replies.

samuelee

Programmer
Apr 12, 2003
10
HK
Dear all,

I've found that I could not connect to databases after I've changed the host name of my machine.

When I login Mysql. the error message prompted:
error 1130: Host 'yyyy' is not allowed to connect to this Mysql server
Then I tried to use host=localhost to login, it worked.

However, when I tried to 'USE' a particular database, this error message prompted :
error 1044: Access denied for user :'@localhost' to databases 'xx'
Besides, I even could not USE the 'mysql' database.

Would you mind telling me how can I solve this problem ? Is there any way to reset the privilege settings of the databases?
Please help !

My environment is as follows :
Linux 7.2
Apache-1.3.20-16
MySql-3.23.41-1
 
one way would be the following

1) service mysqld stop

2) service mysql start --skip-grant-tables


3) /usr/bin/mysqladmin -u root password 'newpassword'


If it does not come right then you have to go the rough way

1) service mysqld stop

2) manually delete the user, db, host, tables_priv, columns_priv in mysql database.

3) re-run mysql_install_db script that will re-create the above tables from scratch.


If you already have important databases copy all frm, MYD, MYI files related to your db somewhere else just in case none of above solutions works and you need to re-install the all mysql server.

Bye

Qatqat

The reason why my girlfriend can read my thoughts is because mine are properly written! (G.Lepore)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top