Home > Database > Mysql Tutorial > What is the way to backup database in mysql

What is the way to backup database in mysql

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2023-05-28 09:28:05
forward
1043 people have browsed it

1. Back up all databases:

shell>mysqldump -uroot -p --all-database > all.sql
Copy after login

2. Back up database test

shell>mysqldump -uroot -p test > test.sql
Copy after login

3. Back up database Table emp under test

shell> mysqldump -uroot -p test emp > emp.sql
Copy after login

4, backup table emp under database test and dept

shell> mysqldump -uroot -p test emp dept > emp_dept.sql
Copy after login

5, Back up all tables under database test as comma-separated text to /tmp:

shell> mysqlddump -uroot -p -T /tmp test emp --fields-terminated-by ','
shell> more emp.txt  
 
1,z1
2,z2
3,z3
4,z4
Copy after login

The above is the detailed content of What is the way to backup database in mysql. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template