Dump a mysql embedded database into a SQL text file [closed]
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this questionI have a mysql embedded database that I need to move into server. I know that for a server I can use mysqldump to backup the data into a SQL text file. But what option do I have for a embedded data开发者_Python百科base?
Thanks, Carlos.
I managed to dump the embedded schema. I got it from a Amarok tips page
libmysqld.dll enables to use mysql in your program without setting up a server or load a deamon. Also it creates the same files as the server (mysql directory, schema directory and ibdata1 file). So I put those files in a directory and told the mysqld linux deamon to use that directory as datadir:
mysqld_safe --user=mysql --datadir=/data/myEmbededDB --skip-grant-tables
--skip-grant-tables will allow to connect with any user or password
Because the server point to that directory now I can dump the embedded schema with mysqldump just like any other mysql schema. The same applies if you want to use WorkBench with a schema created with libmysqld.dll
Hope this help other confused libmysqld.dll users
:-)
Make a dump with mysqldump — A Database Backup Program
Then run script with mysql — The MySQL Command-Line Tool
There are examples, but read about the options. For example for dumping procedures and functions you need to specify '--routines' option, for triggers '--triggers' option.
Also, you could do it with GUI tools. Try Backup/Restore tools or 'Generate Schema Script' in dbForge Studio for MySQL. Tools allow to select objects in a tree, it is more simply and obvious.
精彩评论