Error importing mysql using XAMP

I originally used easyPHP (windows), then switched to mac and used MAMP. i archive my db every once in a while and right before reformatting. The export was done by going to the phpMyAdmin root and using the export function. Now I'm trying to import data, I get this error "# 1044 - Access denied for user" root "@" localhost "to database" information_schema ". Doing other things I got errors like" # 1146 - Table "test_db. COLLATION_CHARACTER_SET_APPLICABILITY "does not exist", "# 1146 - Table" test_db.CHARACTER_SETS "does not exist" and "# 1146 - Table" test_db.COLUMNS "does not exist" and "# 1046 - No database selected

How do I get MAMP to import and ignore any access errors and continue to keep my DB full to its previous state? I prefer not to write an application to do this, but if I had any libraries that I would use to parse sql statements in an sql dump? It doesn't look hard to parse. It looks like a semicolon separates the statements. But what about problems with escapes and unescape? how can i handle this?

0


source to share


1 answer


The first error indicates that there is something wrong with your setup. information_schema is an internal database that stores data about other parts of the system (metadata). You should try reinstalling your MySQL server (or even MAMP in general).

Second: dump files can be imported using the mysql command line client as follows:



mysql -p -u root test_db < dump.sql

      

Remember that "test_db" must be created before restoring the dump. Another possible problem might be that the dump / restore is done by different versions of MySQL (i.e. 5.0 versus 5.1). To do this, you can try the -force command on the mysql command line to skip unsuccessful attempts, however, be aware that this may not properly recover your data.

+2


source







All Articles