명령줄에서 MySQL 데이터베이스의 SQL 덤프를 만드는 방법은 무엇입니까?

명령줄에서 MySQL 데이터베이스의 SQL 덤프를 만드는 방법은 무엇입니까?

2022-10-20 last update

3 minutes reading mysql
MySQL 사용자에게 비밀번호가 있는 경우:

mysqldump -h localhost -u [MySQL user, e.g. root] -p[database password] -c --add-drop-table --add-locks --all --quick --lock-tables [name of the database] > sqldump.sql
참고:  -p와 비밀번호 사이에는 공백이 없습니다!
비밀번호가 없는 경우:
mysqldump -h localhost -u [MySQL user, e.g. root] -c --add-drop-table --add-locks --all --quick --lock-tables [name of the database] > sqldump.sql