• 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

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
How to Setup Paperclip AI: Create a Company for AI Agent
Network

How to Setup Paperclip AI: Create a Company for AI Agent

March 12, 2026
Compilation of free and cheap APIs to run OpenClaw stably
Network

Compilation of free and cheap APIs to run OpenClaw stably

March 10, 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
Inline Feedbacks
View all comments

Recent News

How to create Comic style advertising photos that attract millions of Likes

How to create Comic style advertising photos that attract millions of Likes

June 27, 2026
How to change the default font in Word

How to change the default font in Word

June 27, 2026
Tips for browsing the web with Safari on iPhone

Tips for browsing the web with Safari on iPhone

June 26, 2026
11 reasons to buy a Macbook instead of a Windows Laptop

11 reasons to buy a Macbook instead of a Windows Laptop

June 26, 2026
How to create Comic style advertising photos that attract millions of Likes

How to create Comic style advertising photos that attract millions of Likes

June 27, 2026
How to change the default font in Word

How to change the default font in Word

June 27, 2026
Tips for browsing the web with Safari on iPhone

Tips for browsing the web with Safari on iPhone

June 26, 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 create Comic style advertising photos that attract millions of Likes

How to create Comic style advertising photos that attract millions of Likes

June 27, 2026
How to change the default font in Word

How to change the default font in Word

June 27, 2026
  • Home
  • Home 2
  • Home 3
  • Home 4
  • Home 5
  • Home 6
  • Next Dest Page
  • Sample Page

6789 kv999

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

6789 kv999

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