MYSQL

Mysql 백업 및 복구


Mysql 백업 및 복구


  2021-06-09  465 View 공개

 DB 백업/복구하기

  ◼︎  백업하기
Mysql
$> mysqldump -u [사용자 계정] -p [패스워드] [원본 데이터베이스명] > [생성할 백업 DB명].sql
 
$> mysqldump -u root -p skiresort > skiresort.sql
  ◼︎  복구하기
Mysql
$> mysql -u [사용자 계정] -p [패스워드] [복원할 DB] < [백업된 DB].sql
 
$> mysql -u root -p skiresort < skiresort-01.sql

 Table 백업/복구하기

  ◼︎  백업하기
Mysql
$> mysqldump -u [사용자 계정] -p [패스워드] [데이터베이스명] [원본 백업받을 테이블명] > [백업받을 테이블명].sql
 
$> mysqldump -u root -p skiresort skiresort_member > skiresort-01.sql
  ◼︎  복구하기
Mysql
$> mysql -u [사용자 계정] -p [패스워드] [복원할 DB ] < [백업된 테이블].sql
 
$> mysql -u test_user -p 123456 test_db < backup_test_table.sql

참고자료 (Reference)


Tags  #MySql  



🚩 MYSQL 글 모음 (총 37 건)

[macOS] zsh: command not found: mysql 해결 방법

Last Updated : 2023-09-29
#MySql

Mysql DB생성 및 유저등록

Last Updated : 2023-09-29
#Mysql

Mysql 백업 및 복구

Last Updated : 2023-09-29
#MySql

MySql - POD 예제

Last Updated : 2023-09-29
#MySql

데이터베이스에서 작은따옴표(')를 다루는 방법 : SQL 인젝션 예방과 데이터 출력

Last Updated : 2023-09-29
#Mysql

[mySQL] 특정 레코드가 몇 번째인지 알아내는 방법

Last Updated : 2023-09-10
#mySQL #row_number