Guide Back Up And Restore MySQL Database Via Shell Command Line Terbaru 2019

Guide Back Up And Restore MySQL Database Via Shell Command Line.

Back Up MySQL database. To preserve your SQL database save you should regularly again up it at on every occasion you could. Anything can occur in your pc at any time, as an example, your pc's difficult pressure ought to damage, virus or malicious program attack your file and application, or stolen with the aid of a person, which it reasons your database loses or damaged. To back up the MySQL database is straightforward. We can shop the MySQL database to flash pressure or neighborhood force then repair to the opposite computer systems. All step on this guide the use of a shell command line, so that you should write down each command first earlier than appearing again up and restore MySQL databases. You need to be careful so one can write command here to avoid blunders syntax.

Now, allow we begin our guide to Back Up And Restore MySQL Database Via Shell Command Line. We use mysqldump command to create text document dumps of databases managed through MySQL

Back Up MySQL Database.

  1. Open XAMPP Control panel.
  2. Then click Shell.
  3. Don't make any connection to your SQL server.
  4. For this case, we've created MySQL database on this guide, this database referred to as customers.mySQL databasemySQL database
  5. Now type the following command at shell spark off;
  • mysqldump -uroot database name
Example ;
  • mysqldump -uroot customers
Then press enter button your keyboard.the result ought to return with this.
back up mysql database
back up MySQL database
This result best returned up MySQL database on shell command line. So the way to ship your database into SQL text file? Now follow the following step.

Send the MySQL database into SQL text file.

Once your database correctly backup, now it's time to create SQL unload text record. So, you may move your SQL database to the alternative pc.
  1. Create a folder on a specific force to your computer.
  2. For instance, we would really like to create a statistics folder at force E: so the result will appear like this.
  • E:data
Then type the subsequent command at shell spark off;
  • mysqldump -uroot database name >D:folderfile call.sql
Example;
  • mysqldump -uroot customers >E:data\customers2.sql
Then press input, right here you will see not anything at shell command spark off.now, go to pressure E:dataThere you have to see customers2.sql sell off text report.
sql dump text file
SQL dump text file
Finish, now you may move this SQL record to the opposite computer and restore it to available MySQL database

Restore MySQL database.

  1. Once your SQL text record in hand, now you may pass to the other SQL server. Or you can repair it to the equal server.
  2. Open XAMPP Control panel.
  3. Then click on Shell.
  4. Connect to SQL server, type the following command ;
  • mysql -uroot
Now create a brand new database, for instance, kind the following command ;
  •  create database customers2;
Then set lively this new database, kind the subsequent command ;
  • use customers2;
Now repair customers2.sql text document to customers2 database. type the subsequent command
  • the syntax is : source E:\folder\\file name.sql
Therefore you have to type 
  •  source E:data\\customers2.sql
If your database efficiently restored your command activate need to seem like this.
restore mySQL database - query ok
restore MySQL database - question ok
Now you could take a look at whether or not the database has been efficiently restored to MySQL. Kind the following command ;
  • show databases;
And you ought to your new database there.
restore mySQL database
restore mySQL database
Also, you could check all to be had desk in this database. Kind the subsequent command ;
  • show tables;
Finish, congratulations you have got effectively lower back up and repair your SQL database
Guide Back Up And Restore MySQL Database Via Shell Command Line Terbaru 2019Guide Back Up And Restore MySQL Database Via Shell Command Line. Back Up MySQL database.  To preserve your SQL database save you should reg...

Artikel Terkait

Berikan Komentar

  1. Untuk menulis kode gunakan <i>KODE</i>
  2. Untuk menyisipkan kode ke dalam Syntax Highlighter gunakan <em>KODE YANG LEBIH PANJANG</em>
  3. Kode harus di-parse terlebih dulu agar bisa ditulis.
  4. Centang Notify me untuk mendapatkan notifikasi balasan komentar melalui Email.
histats