Web Hosting Talk







View Full Version : Mysql root Access problem*


jasacom
10-18-2004, 11:52 PM
I have Mysql 4.0.20 installed on RAQ550. I donīt now why, but since few days ago, if I login as root, it let me in, but I doīt have privileges to create new Databases. I see all databases on localhost, but I canīt create the new one. Please help me what can I do, or where is the problem. Thank you

advantagecom
10-19-2004, 01:47 PM
Assuming that you're logging into MySQL as root (and not just server root), you've got yourself into a bit of a pickle. The problem would be in the 'grant' tables. That's where the permissions allowed for each user are stored.

My experience is from MySQL 3.x, so I'm not 100% sure this advice will work in your case, but I don't believe 4.x is much different.

What I'd suggest is that you shut down the database server and backup all of the data files (usually in /var/lib/mysql/). Don't skip the backup. If things go wrong, you'll need it. Hopefully, you already have a list of all database users and their passwords, because you'll have to re-enter them.

Then, while the server is still shut down, delete the following files in the mysql database (the database called "mysql"):

columns_priv.frm
columns_priv.MYD
columns_priv.MYI
tables_priv.frm
tables_priv.MYD
tables_priv.MYI

Then, reinstall the RPM for the MySQL server. That should give root the default privileges again. Of course, you'll have to regrant permissions for each of the existing users and setup any other custom settings you need.

Legal Disclaimer: Use this advice at your own risk and expense. If my advice is totally wrong and causes undue grief or any other negative result, you accept full responsibility for choosing your own actions regardless of my recommendations or advice.

meknow
10-19-2004, 01:59 PM
It depend on your situation but this might help.
http://dev.mysql.com/doc/mysql/en/Resetting_permissions.html

the url describe how to reset root password but it can be applied to anything you want. If you want to change permission.
1. stop mysql
2. start mysql with option to override the permission like mysqld_safe --skip-grant-tables &
3. Do whatever you supposed to do following line change password. you may change permission also
mysqladmin -u root flush-privileges password "newpwd"
4. kill mysql and start again as normal or just do restart.

This instruction is quite plain and you suppose to change option whatever you need.

hope this help.

I strongly against dealing on the db file directly if you don't know what you are doing.

advantagecom
10-19-2004, 02:26 PM
Good advice. I'd say that meknow's way is a better first option.

jasacom
10-19-2004, 03:54 PM
Thank you again. I have it. I have deleted mysql database, and My lack was, I didn't have tomuch databases to reenter username and Password. I have reinstalled Mysql , and all works fine now. Thank you again