Step 1: Open command prompt in administrator mode on Windows machine. Navigate to the path bin directory where MySQL was installed.
e.g. cd C:\Program Files\MySQL\MySQL Server 8.0\bin
Step 2: Once in that directory, Please select either option a or b below..
a.) To export a complete applicare database, including both its structure and its data.
mysqldump.exe -u <Username> -p <database_name> > <Backup_directory>\applicare.sqle.g.
mysqldump.exe -u root -p applicare > C:\Applicare_DB_Backup\applicare.sql(OR)
b.) To export only the data (the INSERT statements) without the CREATE TABLE structures, We need to use the --no-create-info argument with mysql backup command.
mysql -u <username> -p --no-create-info <destination_db_name> <Backup_directory>\applicare.sqle.g.
mysqldump.exe -u root -p --no-create-info applicare > C:\Applicare_DB_Backup\applicare.sqlStep 3: After running the command, MySQL will prompt you for a password, Enter the password and wait few minutes for the process to complete.
After executing the command, verify that there is SQL file named applicare.sql in backup directory.
To import .sql backup file into another MySQL database, Use the standard mysql command.
Step 4: Before running the command, ensure the destination database already exists. If it doesn't, Create the database.
Step 5: Open command prompt in administrator mode on Windows machine. Navigate to the path bin directory where MySQL was installed.
e.g. cd C:\Program Files\MySQL\MySQL Server 8.0\bin
Step 6: Once in that directory, execute the following command.
mysql -u [username] -p [destination_database_name] < C:\backups\applicare.sqle.g.
mysql -u root -p applicarearchieve < C:\applicaredb_backup\applicare.sqlAfter running the command, MySQL will prompt you for a password, Enter the password and wait few minutes for the process to complete.
Comments
0 comments
Article is closed for comments.