System Restore: MySQL Databases

RayManZ

Verified User
Joined
Nov 8, 2004
Messages
90
Hi,

I just did a full system restore (pretty easy :)) But one thing left... Mysql databases.

Where do i put those? Alot of users have databases and i want to restore those to, but i don't know where.

Tnx :)
 
Do you have the actual MySQL data files or .sql backups? If the first then you put them in the directory MySQL loads data from. Depending on your system it's usually /home/mysql or can also be in one of the /var/ subdirectories.

If you have .sql files you'll have to restore the databases either through phpmyadmin or the command line depending on the filesize.
 
I made the backup with system backup from DA

I have the .sql files.

I have around 50 databases. How do i put them online the easy way?
 
New problem:

If i want to create a new DB i get this error:

Error connecting to MySQL: Access denied for user: 'da_admin@localhost' (Using password: YES)
 
It depends how thourough your backup is. Do you have the actual mysql database itself? (the one that has permissions?)
If so you can restore all databases including that one from the command line, otherwise you'll have to recreate accounts etc. etc.
 
the accounts are already there. Only the users don't have there databases.

I have taken a look in a .sql file but the database itself isn't there. Only the data....

So now i have to tell my customers te recreate there database en put the .sql file on?

How do i do that by ssh? The right commandline?

The other problem is fixed btw :) Tnx for that
 
The directadmin accounts are already there yes, but not the mysql accounts, right?

For each .sql file you will need to figure out it's name and restore it for that user account.
For example smith_phpbb.sql would probably indicate the user smith and the database name of smith_phpbb

From the command line, a restore might go something like:
mysql -u$user -p$pass DBNAME < DBNAME_dump.sql
 
Stop.

Backup.

Take a deep breath.

This problem was actually addressed in a recent post; search these forums.

It's because the newest version of MySQL (which it appears is now installed in new DA installs) uses a different password schema.

My thanks to Onno, who brought this to my attention.

Jeff
 
i found out that i had the full mysql backup.

:)

full_mysql.tar.gz

This one contains all the mysql data from the /var/lib/mysql dir. Just untar it there and whoopa everything works again.

Then just restart mysqld and httpd and it's just fine.

Thanks for all the help :)
 
As Jeff stated the problem is isolated and there is a fix for this, I'll ask Jeff to post the HOWTO so that other people can also bennefit from this.

Regards,
Onno
 
Done, Onno.

Please check it out and make sure I didn't err in my transcription.

Thanks.

Jeff
 
Back
Top