I am using Mysql database to maintain the record of employee data. I want to the information on mysqldump command. Can any one tell me how to use mysqldump and what are the syntax is use while declaring mysqldump command in mysql.
I am using Mysql database to maintain the record of employee data. I want to the information on mysqldump command. Can any one tell me how to use mysqldump and what are the syntax is use while declaring mysqldump command in mysql.
Mysqldump command is used in mysql , it is a standalone and shouldn't be runing inside mysql. If you have either a shell or telnet access to your database server, you can backup the database using mysqldump. By default, the output of the command will dump the contents of the database in SQL statements to your console. Using mysqldump, you can backup a local database and restore it on a remote database at the same time, using a single command.
This are the following commands are useful with mysqldump :
orCode:mysqldump –-user [user name] –-password=[password] [database name] > [dump file]
Code:mysqldump –u[user name] –p[password] [database name] > [dump file]
Usually you run mysqldump to create database copy: $ mysqldump -u user -p db-name > db-name.out
Copy db-name.out file using sftp/ssh to remote MySQL server: $ scp db-name.out user@site name:/backup
Restore database at remote server (login over ssh): $ mysql -u user -p db-name < db-name.out
Bookmarks