mysql export & import

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/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/545828/viewspace-1024092/

你可能感兴趣的:(mysql export & import)