faqts : Computers : Databases : MySQL

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

12 of 14 people (86%) answered Yes
Recently 9 of 10 people (90%) answered Yes

Entry

I had to re-install mysql, how do I restore a large myswl databse so that mysql recognizes it?

Feb 13th, 2008 00:32
dman, Jason Ross, Rick Hill, http://sturly.com


There's a couple of ways to accomplish this:
- Assuming you have a dump of the database, you can just run the 
following command: (Shown below from unix command line, works exactly 
the same way from DOS prompt)

# mysql -u user -p < dumpfile.sql
Enter Password: *******

# 

That will read the sql in the dump file into the database and recreate 
any databases with their tables and data, etc.

- If you have not got a dump, but do have a filesystem 
backup of at least the mysql/data directory, you should be able to  
simply copy the directories under mysql/data into the newly installed 
location, and restart mysql.

If you have not got either a backup of the data directory or a dump of 
the database, then you're pretty much done for =0)


=[ jason ]=