Revision [748]

Last edited on 2008-10-02 11:00:40 by FsseInfo
Additions:
but instead of just trying to copy these directly you should use the MySql utilities to backup and restore your database
See also
MySqlDump and MySqlRestore
Deletions:
but instead of just trying to copy these directly you should use the MySqlDump and "mysql" commands to backup and restore your database


Revision [397]

Edited on 2007-06-30 17:56:25 by FsseInfo
Additions:
===MySql Database Backup & Restore===
The MySql data files are located in
%%
/var/lib/mysql
%%
but instead of just trying to copy these directly you should use the MySqlDump and "mysql" commands to backup and restore your database

==Quick Backup==
%%(bash)
#
cat dblist | while read -r db
do
echo $db
mysqldump --add-drop-table --allow-keywords --quote-names $db > $db.sql
done
%%

==Quick Restore==
%%(bash)
#
cat dblist | while read -r db
do
echo $db
mysql -e "DROP DATABASE IF EXISTS \`$db\`"
mysql -e "CREATE DATABASE IF NOT EXISTS \`$db\`"
mysql $db < $db.sql
done
%%

----
REFERRERS
{{backlinks}}
Deletions:
===MySql Database Backup


Revision [394]

Edited on 2007-06-30 00:14:59 by Id8Ace
Additions:
===MySql Database Backup
Deletions:
===MySql Database Backup & Restore===
The MySql data files are located in
%%
/var/lib/mysql
%%
but instead of just trying to copy these directly you should use the MySqlDump and "mysql" commands to backup and restore your database

==Quick Backup==
%%(bash)
#
cat dblist | while read -r db
do
echo $db
mysqldump --add-drop-table --allow-keywords --quote-names $db > $db.sql
done
%%

==Quick Restore==
%%(bash)
#
cat dblist | while read -r db
do
echo $db
mysql -e "DROP DATABASE IF EXISTS \`$db\`"
mysql -e "CREATE DATABASE IF NOT EXISTS \`$db\`"
mysql $db < $db.sql
done
%%

----
REFERRERS
{{backlinks}}


Revision [374]

Edited on 2007-04-20 09:48:04 by FsseInfo
Additions:
===MySql Database Backup & Restore===
The MySql data files are located in
%%
/var/lib/mysql
%%
but instead of just trying to copy these directly you should use the MySqlDump and "mysql" commands to backup and restore your database

==Quick Backup==
%%(bash)
#
cat dblist | while read -r db
do
echo $db
mysqldump --add-drop-table --allow-keywords --quote-names $db > $db.sql
done
%%

==Quick Restore==
%%(bash)
#
cat dblist | while read -r db
do
echo $db
mysql -e "DROP DATABASE IF EXISTS \`$db\`"
mysql -e "CREATE DATABASE IF NOT EXISTS \`$db\`"
mysql $db < $db.sql
done
%%

----
REFERRERS
{{backlinks}}
Deletions:
===MySql Database Backup


Revision [371]

Edited on 2007-04-20 01:18:29 by NuzIbw
Additions:
===MySql Database Backup
Deletions:
===MySql Database Backup & Restore===
The MySql data files are located in
%%
/var/lib/mysql
%%
but instead of just trying to copy these directly you should use the MySqlDump and "mysql" commands to backup and restore your database

==Quick Backup==
%%(bash)
#
cat dblist | while read -r db
do
echo $db
mysqldump --add-drop-table --allow-keywords --quote-names $db > $db.sql
done
%%

==Quick Restore==
%%(bash)
#
cat dblist | while read -r db
do
echo $db
mysql -e "DROP DATABASE IF EXISTS \`$db\`"
mysql -e "CREATE DATABASE IF NOT EXISTS \`$db\`"
mysql $db < $db.sql
done
%%

----
REFERRERS
{{backlinks}}


Revision [282]

Edited on 2006-11-29 04:13:10 by FsseInfo
Additions:
===MySql Database Backup & Restore===
==Quick Backup==
%%(bash)
#
cat dblist | while read -r db
do
echo $db
mysqldump --add-drop-table --allow-keywords --quote-names $db > $db.sql
done
==Quick Restore==
%%(bash)
#
cat dblist | while read -r db
do
echo $db
mysql -e "DROP DATABASE IF EXISTS \`$db\`"
mysql -e "CREATE DATABASE IF NOT EXISTS \`$db\`"
mysql $db < $db.sql
done
Deletions:
===MySql Backup & Restore===


Revision [259]

Edited on 2006-11-24 12:03:46 by FsseInfo
Additions:
but instead of just trying to copy these directly you should use the MySqlDump and "mysql" commands to backup and restore your database
Deletions:
but instead of just trying to copy these directly you should use the "mysqldump" and "mysql" commands to backup and restore your database
==Backup==
$ mysqldump -u mysqluser -p mydbname > mydbbackup.sql
or
$ mysqldump --user=mysqluser --password --databases mydbname > mydbbackup.sql
==Backup Structure only==
$ mysqldump -u mysqluser -p mydbname --hex-blob --no-data --skip-quote-names > mydbnamestruct.sql
==Restore==
$ mysql -u username -p mydbname < mydbbackup.sql
or
$ mysql --user=username --password mydbname < mydbbackup.sql
%%


Revision [132]

Edited on 2006-09-20 04:14:00 by FsseInfo
Additions:
===MySql Backup & Restore===
but instead of just trying to copy these directly you should use the "mysqldump" and "mysql" commands to backup and restore your database
==Backup==
$ mysqldump -u mysqluser -p mydbname > mydbbackup.sql
$ mysqldump --user=mysqluser --password --databases mydbname > mydbbackup.sql
==Backup Structure only==
$ mysqldump -u mysqluser -p mydbname --hex-blob --no-data --skip-quote-names > mydbnamestruct.sql
==Restore==
$ mysql -u username -p mydbname < mydbbackup.sql
$ mysql --user=username --password mydbname < mydbbackup.sql
Deletions:
===MySql Data Files===
but instead of just trying to copy these directly you should use the "mysqldump" and "mysql" commands
===Backup===
# mysqldump -u wikkawiki -p mydbname > mydbbackup.sql
# mysqldump --user=wikkawiki --password --databases mydbname > mydbbackup.sql
===Restore===
# mysql -u username -p mydbname < mydbbackup.sql
# mysql --user=username --password mydbname < mydbbackup.sql


Revision [34]

The oldest known version of this page was created on 2006-06-19 11:32:35 by FsseInfo
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki