본문 바로가기

프로그래밍/MySQL

Running a syntax check on /etc/my.cnf

반응형

Usually, I update variables on the fly using something like:

mysql> SET GLOBAL max_connections = 150;

… and then modify /etc/my.cnf to make the change persistent.

The problem in doing this is that you’re not verifying that your /etc/my.cnf is correct and can only hope that a restart doesn’t encounter any problems.

Fortunately, Sai emailed us a great little tip to verify the syntax. You can run the following which will report errors in /etc/my.cnf:

# /usr/libexec/mysqld --help --verbose
081009  9:55:36 [ERROR] /usr/libexec/mysqld: unknown variable 'mmax_connections=150'
 
#

Perfect. Just what the doctor ordered.

 

 

하지만 난 mysqld가 저 경로에 없었다..

#mysqld --help --verbose

 

또는..

#which mysqld 한 뒤에..

/usr/sbin/mysqld 이 위치라는걸 보고

 

#/usr/sbin/mysqld --help --verbose 를 했다.

반응형