mysql -p
<enter password>
create database new_database;
quit
mysqldump old_database -p | mysql -D new_database -p
<enter password>
It'll dump out the old database to STDOUT, pipe this to a second MySQL process and insert the dumped data (and schema) to the new DB.
You'll have to manually DROP the old DB and change the permissions on the new DB, but at least you have the data and schema.
I find this very useful for creating 'live' backups of databases.
ได้มาจาก
http://www.delphifaq.com/faq/databases/mysql/f574.shtml