1

I have a backup from a WAMP server MYSQL database from home and I need to install it on my work WAMP setup.

I currently don't have access to my original database and so, can't just export specific tables.

Here is the phpmyadmin message:

SQL query:

--
-- Database: `information_schema`
--
CREATE DATABASE  `information_schema` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;


MySQL said: 

#1044 - Access denied for user 'root'@'localhost' to database 'information_schema' 

The information_schema database appears to be locked and the restore fails in phpmyadmin. In the MYSQL Workbench it carries on through the backup ignoring the "access denied" messages but crashes halfway through.

I have tried removeing the database_schema lines in the sql file but it just looks like a mess of text and can't figure out how to remove it.

Another thing is will I actually need it? Or can I remove it. I'm not too sure what information is stored there.

Thank you.

2
  • Maybe your backup file is too large that causes crash of workbench?
    – Leri
    Jun 11, 2012 at 8:06
  • I don't think it would be. There is only a small amount of test information and the .sql file is 750kb.
    – joshkrz
    Jun 11, 2012 at 8:10

2 Answers 2

6

The MySQL INFORMATION_SCHEMA database is a system database:

INFORMATION_SCHEMA provides access to database metadata, information about the MySQL server such as the name of a database or table, the data type of a column, or access privileges. Other terms that are sometimes used for this information are data dictionary and system catalog.

It is modified by MySQL when you create or modify databases and tables. You cannot modify the INFORMATION_SCHEMA database:

Although you can select INFORMATION_SCHEMA as the default database with a USE statement, you can only read the contents of tables, not perform INSERT, UPDATE, or DELETE operations on them.

A sane MySQL export utility will omit system tables when exporting databases and you should not import this database at all. Just import "user" databases; MySQL will build/update the system databases itself.

5
  • I would but I currently don't have access to my original database. I need to know how to remove the information_schemas from the .sql files or to omit them some other way.
    – joshkrz
    Jun 11, 2012 at 8:14
  • 1
    Remove the line that has CREATE DATABASE ..
    – Gntem
    Jun 11, 2012 at 8:18
  • You're NOT supposed to write anything in that table directly. See edited answer.
    – Salman A
    Jun 11, 2012 at 8:22
  • I know I don't need to. I accidently selected all tables when exporting from MYSQL workbench. Thank you for your information though.
    – joshkrz
    Jun 11, 2012 at 8:45
  • This is the better answer for all others not having this particular "file-editing" problem.
    – hgoebl
    Jan 9, 2014 at 7:56
1

I have managed to do this myself with the help of @GeoPhoenix.

I opened the sql file in Dreamweaver then found "-- -- Database:" using ctrl-F and deleted all information up to the next "-- -- Database:" part and repeated the process until I was left with the information I needed to keep.

Thank you all for your help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.