• 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

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
3 Services to Determine IP Location for Website (IP Geolocation API)
Network

3 Services to Determine IP Location for Website (IP Geolocation API)

March 10, 2026
How to buy a .STORE domain name for 1 USD (2026): Detailed instructions from A–Z
Network

How to buy a .STORE domain name for 1 USD (2026): Detailed instructions from A–Z

March 3, 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 a Face Sticker Collection using ChatGPT

How to create a Face Sticker Collection using ChatGPT

April 29, 2026
How to install the cute Bongo Cat mouse pointer for Windows

How to install the cute Bongo Cat mouse pointer for Windows

April 29, 2026
Tips for pinning the step counter to the iPhone screen to monitor your health

Tips for pinning the step counter to the iPhone screen to monitor your health

April 28, 2026
How to turn off password suggestions on iPhone: Prevent Safari from auto-filling passwords

How to turn off password suggestions on iPhone: Prevent Safari from auto-filling passwords

April 27, 2026
How to create a Face Sticker Collection using ChatGPT

How to create a Face Sticker Collection using ChatGPT

April 29, 2026
How to install the cute Bongo Cat mouse pointer for Windows

How to install the cute Bongo Cat mouse pointer for Windows

April 29, 2026
Tips for pinning the step counter to the iPhone screen to monitor your health

Tips for pinning the step counter to the iPhone screen to monitor your health

April 28, 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 a Face Sticker Collection using ChatGPT

How to create a Face Sticker Collection using ChatGPT

April 29, 2026
How to install the cute Bongo Cat mouse pointer for Windows

How to install the cute Bongo Cat mouse pointer for Windows

April 29, 2026
No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office

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