• Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
AnonyViet - English Version
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
AnonyViet - English Version
No Result
View All Result

Backup and Restore MySQL Database with command (Command)

AnonyViet by AnonyViet
January 27, 2023
in Network
0

Backing up data is an integral part of a Database administrator. Hence the work backup (backup) MySQL database regularly is necessary. Most of you often use phpmyadmin to backup or restore.

You can simplify by use command in terminal To backup and restore, follow the instructions below:

General notes in commands:

[uname] : user database
[dbname] : Tên database
[bk.sql] : Tên file backup sẽ được tạo ra
[--opt] : Các tùy chọn thêm của lệnh

Join the channel Telegram of the AnonyViet 👉 Link 👈

1. Backup by command in Terminal (backup)

Use the following structure:

$ mysqldump --opt -u [uname] -p [dbname] > [bk.sql]

Eg : To backup database Duyquangnet

$ mysqldump -u root -p duyquangnet > bk_duyquangnet.sql

You can also customize the backup separately from the table by selecting the table to backup with the command below:

$ mysqldump -u root -p duyquangnet table_a table_b > bk_duyquangnet.sql

Back up MySQL Database automatically compresses

If your database is too large, you can let it automatically compress to reduce the size, we can use the compression command structure with gzip

$ mysqldump -u [uname] -p [dbname] | gzip -9 > [bk_duyquangnet.sql.gz]

2. Restore MySQL Database

The command below is used to Restore, used in case your Database has a problem or error, and you want to restore the previous version.

Requirements: Must have a file backup database (in item 1)

$ mysql -u [uname] -p [dbname] < [backupfile.sql]

Example: Restore database Duyquangnet

$ mysql -u root -p duyquangnet < bk_duyquangnet.sql

Recover a pre-compressed database

gunzip < [backupfile.sql.gz] | mysql -u [uname] -p [dbname]

If you have an already created database, then use the mysqlimport command to restore. The command structure is as follows:

mysqlimport -u [uname] -p [dbname] [bk.sql]
Tags: BackupCommandDatabaseMySQLrestore
Previous Post

How to Turn Off Comments on Facebook Posts

Next Post

How to change your SIM PIN to help prevent thieves from using your phone’s SIM

AnonyViet

AnonyViet

Related Posts

Instructions for detecting network vulnerabilities: How to check the system for data leaks (IP/DNS)
Network

Instructions for detecting network vulnerabilities: How to check the system for data leaks (IP/DNS)

October 9, 2026
Is Renting a Cheap VPS to Run Docker Really Effective?
Network

Is Renting a Cheap VPS to Run Docker Really Effective?

July 2, 2026
How to get a free domain for 1 year from Gravatar
Network

How to get a free domain for 1 year from Gravatar

June 23, 2026
Cloud Infrastructure Resilience: Mitigating Advanced Layer 7 Vulnerabilities and Securing High-Throughput Database Handshakes
Network

Cloud Infrastructure Resilience: Mitigating Advanced Layer 7 Vulnerabilities and Securing High-Throughput Database Handshakes

June 20, 2026
Save image as Type contains malicious code: Remove immediately before losing money unfairly!
Network

Save image as Type contains malicious code: Remove immediately before losing money unfairly!

March 19, 2026
Instructions on how to register a .co.uk domain name for free for 1 year
Network

Instructions on how to register a .co.uk domain name for free for 1 year

March 12, 2026
Next Post
How to change your SIM PIN to help prevent thieves from using your phone’s SIM

How to change your SIM PIN to help prevent thieves from using your phone's SIM

0 0 votes
Article Rating
Subscribe
Login
Notify of
guest

guest

0 Comments
Oldest
Newest Most Voted

Recent News

How to report a fraudulent website on Weebly

How to report a fraudulent website on Weebly

October 19, 2026
How to view Facebook stories without others knowing

How to view Facebook stories without others knowing

October 18, 2026
Instructions for registering a .tech domain name for free for 1 year

Instructions for registering a .tech domain name for free for 1 year

October 18, 2026
Instructions on how to enter promotional codes on the App Store most accurately

Instructions on how to enter promotional codes on the App Store most accurately

October 18, 2026
How to report a fraudulent website on Weebly

How to report a fraudulent website on Weebly

October 19, 2026
How to view Facebook stories without others knowing

How to view Facebook stories without others knowing

October 18, 2026
Instructions for registering a .tech domain name for free for 1 year

Instructions for registering a .tech domain name for free for 1 year

October 18, 2026
AnonyViet - English Version

AnonyViet

AnonyViet is a website share knowledge that you have never learned in school!

We are ready to welcome your comments, as well as your articles sent to AnonyViet.

Follow Us

Contact:

Email: anonyviet.com[@]gmail.com

Main Website: https://anonyviet.com

Recent News

How to report a fraudulent website on Weebly

How to report a fraudulent website on Weebly

October 19, 2026
How to view Facebook stories without others knowing

How to view Facebook stories without others knowing

October 18, 2026
  • Home
  • Home 2
  • Home 3
  • Home 4
  • Home 5
  • Home 6
  • Next Dest Page
  • Sample Page

say88 tỷ lệ kèo nhà cái kèo nhà cái 5 febet

No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office

say88 tỷ lệ kèo nhà cái kèo nhà cái 5 febet

wpDiscuz
0
0
Would love your thoughts, please comment.x
()
x
| Reply