PDA

View Full Version : mysql access problem


responderman
2004-08-16, 15:59 PM
Hi-

I have someone doing some script work and database copying and moving for me and he is having the following problem:

" I need root access to copy the old database, it will not let me in
with root xxxxxxx It will let me in with the other but denies
access to the /var/lib/mysql directory"

He has my root pass, cpanel user/pass and my prime user/pass (he's a family member so that's why I didn't mind giving them to him)

Is there some sort of permission I need to change? I have had others do similiar work and never had this problem before so I am not sure why he can't access this myaql directory.

Any help would be appreciated.

Rich

responderman
2004-08-16, 16:33 PM
Just to clarify:

He is not able to get root access to the mysql files on the server
even with my user/ passwords

How can I fix this?

thanks,
Rich

LittleBrother
2004-08-26, 22:25 PM
I use putty.exe to connect to the IP, then login with username like williamj and password. Then once logged in type su - <enter>

That logs you into root WITH root privs.

Now cd to the folder with your files. Then cp them to the /var/lib/mysql folder.

Then what I usually do is create a database with the appliance GUI then go back to this command line and do a restore of the old file to the new one. Mine wont work unless I leave a space between -p and the password

mysql -uwilliamj -p password forumdatabase < oldforumdbbackup.sql

That restores the old backup into the new clean database.

Hope that helps and I am not too terribly off base....

Tino Didriksen
2004-08-26, 22:45 PM
"I need root access to copy the old database, it will not let me in
with root xxxxxxx It will let me in with the other but denies
access to the /var/lib/mysql directory" No he doesn't. And you should not give him shell root access just to do a database backup. He does not need to access /var/lib/mysql, since that is the wrong way to backup/restore MySQL databases.

You use mysqldump to create the backup; with the MySQL root user, not the master Linux root user. Those two should have different passwords, btw.

Then you use mysql like LittleBrother explained to restore the databases.

To summarize, do not give root to someone just to backup/restore databases.

Tino Didriksen
2004-08-26, 22:46 PM
--- double post ---