PHP & MySQL Tutorial
- mysqldump etc.
mysqldump is a command used to dump a database or a collection of databases for backup.
However, unlike "select" or "update", it is not mysql syntax command, it's an executable located in C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin. So, if we issue mysqldump as the picture in the below, we get error.
So, let's get out of the client command line window, and go into regular command prompt. Then, issue it. If path to the executable has been set, we get the following.
We're going to use mydb which has a table called k_pop as shown in the picture below.
Now, it's time to backup the database mbdb. The following command is using root as a user, and the password will be prompted after the command. The name of the backup file is mydb.sql, and it's in the dbBackups directory as we see in the picture below.
To load the backup database into a new database, we created mydb2 database.
Then, we can load the backup database into a new database mydb2
Ph.D. / Golden Gate Ave, San Francisco / Seoul National Univ / Carnegie Mellon / UC Berkeley / DevOps / Deep Learning / Visualization