mysqldump
mysql 루트 사용자로 실행하는 데 문제가 있습니다. mysql
테이블 을 백업하려고 하면이 오류가 발생합니다.
mysqldump: Got error: 1142: SELECT,LOCK TABL command denied to user
'root'@'localhost' for table 'cond_instances' when using LOCK TABLES
전에 본 사람 있어요? 내 mysql과 mysqldump에 대한 참조가 다른 버전이지만 동일한 디렉토리에있는 것을 실행할 때 참조합니다.
MySQL 5.5.8을 실행 중입니다.
답변
mysqldump 명령에 –skip-add-locks 추가
답변
–skip-add-locks가 작동하지 않습니다 :
# mysqldump -u root -p`cat mysqlRoot.txt` --databases performance_schema --routines --quote-names --skip-add-locks > mysql_performance_schema
mysqldump: Got error: 1142: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'cond_instances' when using LOCK TABLES
대신 –skip-lock-tables를 원합니다.
답변
(이것은 8 개월 늦게 온다는 것을 알고 있습니다)
이것은 잠금 문제가 아니며 제공되는 솔루션은 실제 문제를 우회합니다.
5.5 의 mysqldump 응용 프로그램은 수출하지 말아야 performance_schema
처음에 데이터베이스를.
이전 경험을 바탕으로 mysqldump
사용한 프로그램이 5.1 버전 인 것이 좋습니다 . 말하는 방법? 발행물:
mysqldump --version
5.1 클라이언트의 “미래”존재를 인식하지 못 performance_schema
하기 때문에 그것을 덤프하려고 시도합니다. 해서는 안된다는 것을 알지 못합니다.
5.5 버전을 찾아서 제안 된 잠금을 추가하지 않고 덤프에 사용하십시오.
답변
Shlomi Noach가 언급했듯이 performance_schema는 백업하지 않아야합니다.
이 문제를 해결하는 쉬운 방법은 구성 파일에서 다음을 설정하는 것입니다.
CONFIG_db_exclude=( 'performance_schema' 'information_schema' )