Difference between revisions of "Maintenance (MySQL)"

Jump to navigation Jump to search
588 bytes added ,  00:27, 26 November 2014
→‎Migrate Databases: Added "Ignore Foreign Key Checks"
m (→‎SHOW etc: version)
(→‎Migrate Databases: Added "Ignore Foreign Key Checks")
 
Line 114: Line 114:
# Give you client server access to the new database
# Give you client server access to the new database
#* <code> GRANT ALL PRIVILEGES on destdb.* to 'destdbuser'@'clientsvr' IDENTIFIED BY 'password'; </code>
#* <code> GRANT ALL PRIVILEGES on destdb.* to 'destdbuser'@'clientsvr' IDENTIFIED BY 'password'; </code>
=== Ignore Foreign Key Checks ===
If you receive an error similar to the following when trying to reimport a dump, its likely that you are falling fowl of foreign key checks which will fail as the table with the foreign key doesn't appear until later in the dump file
* <code>ERROR 1005 (HY000) at line 14475: Can't create table 'db.table' (errno: 150)</code>
Before starting the dump, disable foreign key checks
* <code> mysql -u root -p -e "SET GLOBAL foreign_key_checks=0"</code>
Then re-enable once all finished
* <code> mysql -u root -p -e "SET GLOBAL foreign_key_checks=1"</code>


== Create Blank Copy ==
== Create Blank Copy ==

Navigation menu