digital.forest Technical Support
How do I import and export data into my MySQL database?


The easiest way to get your data in and out of our mySQL server is to use a mySQL client program. See How do I connect to my MySQL database with an external client? and What are some common external MySQL clients? for more details.

Another option is to use the command line mySQL utilities to create a dump file of the database on your local machine. You can download the latest version of mySQL for your platform from http://dev.mysql.com/downloads/mysql/4.0.html.

Both the Mac OS X and Windows version now include graphical installers to make the installation process simple.

To save a "dump" of the database on our mySQL server to a file on your local hard disk:

mysqldump (databasename) --host=(databasehost) --user=(yourusername) --password >> databasedump.txt

For example, if your username is "jsmith", your database name is "products", and your databases are on boysenberry.forest.net

mysqldump products --host=boysenberry.forest.net --user=jsmith --password

You'll be prompted to enter your account password after you hit enter.

To upload a "dump" on your local disk to our mySQL server

mysql --user=yourusername --database=yourdatabasename -p << databasedump.txt

For example, if your username is "jsmith", your database name is "products", and your databases are on boysenberry.forest.net

mysql --user=jsmith --database=products -p << databasedump.txt