Home > Database > Mysql Tutorial > body text

What is the way to backup database in mysql

WBOY
Release: 2023-05-28 09:28:05
forward
808 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:
source:yisu.com
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 [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!