본문 바로가기
Database

Database 업데이트, 백업, 복원 명령어 모음

by Miners1205 2023. 8. 10.
반응형

1. Databse 업데이트 명령어 

  • 데이터베이스 테이블 업데이트
# tabletest 테이블에 test 항목의 real을 모두 test로 변경

MariaDB [tables]> update tabletest set test='test' where test='real';​

 

2. Database 백업 & 복원 명령어

  • 데이터베이스 백업 & 복원 
* [전체 데이터베이스 백업& 복원]
MySQL/MariaDB 전체 데이터베이스를 백업받는다.

mysqldump -uroot -p -A > backup_full.sql

* 생성된 덤프를 이용한 복원
mysql -uroot -p < backup_full.sql

* [특정 데이터베이스 백업]
sw_test 라는 데이터베이스만 백업
mysqldump -uroot -p sw_test > backup_sw_test.sql

 

반응형