
따라서 mysqldump는 다음 오류를 발생시킵니다:
mysqldump: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf at line 22!
mysqldump: [ERROR] Fatal error in defaults handling. Program aborted!
내 my.cnf는 매우 기본적입니다.
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
event-scheduler=ENABLED
추가 질문: 추가 보안을 위해 구성 파일에 뭔가를 추가해야 합니까? 그리고 가급적이면 phpmyadmin을 사용하여 테이블을 압축할 수 있나요?
답변1
이 내용이 표시되는 데는 두 가지 이유가 있습니다.
이유 1
파일 에 인코딩이 my.cnf
없습니다 UTF-8
. od
명령을 사용하여 이 인코딩에 없는 것이 있는지 확인할 수 있습니다 .
이유 2
[mysqld]
파일 상단에 지시문이 없습니다 . 내가 보기에 해당 옵션이 없으므로 간단히 추가하고 다시 시도하세요.
추가 질문: 추가 보안을 위해 구성 파일에 뭔가를 추가해야 합니까?
일반적으로 MySQL을 실행하여 듣기만 하는 127.0.0.1
것은 좋은 습관입니다. 왜냐하면 로컬 컴퓨터에서만 연결을 허용하기 때문입니다. 나머지 보안 옵션은 데이터베이스, 테이블 등에 부여한 권한을 기반으로 합니다.
그리고 가급적이면 phpmyadmin을 사용하여 테이블을 압축할 수 있나요?
InnoDB는 압축을 허용합니다. 참조참조 매뉴얼더 많은 정보를 위해서.