mysql export & import

huakaibird發表於2009-07-13

export: mysqldump database [table] > /tmp/filename

import: mysql database < /tmp/filename

can add "max_allowed_packet=104857600" under [mysqld] in /etc/my.cnf file to resolve the "Got a packet bigger than 'max_allowed_packet' bytes" problem.

There is some problems with this import method.

If the mysqldump version is low, the triggers and procedure can not be export. You can upgrade the mysqldump or use remote new version mysqldump to export.

trigger is default, procedure need parameter

mysqldump -u -p -h -R(procedure) dbname > file

Note:

1.When the mysql version is upgrated from low version, need to execute the

/usr/bin/mysql_fix_privilege_tables to extend the procedure and other privileges.

2. When the procedure is recursive, need to add 'max_sp_recursion_depth=500000' under [mysqld] section in my.cnf file

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/545828/viewspace-1024092/,如需轉載,請註明出處,否則將追究法律責任。

相關文章