環境:CentOS6.4+MySQL5.6.39 Case復現: 源碼安裝MySQL5.6.39,不修改配置文件初始化後啟動mysql,此時服務正常啟動且已產生配置文件/etc/my.cnf,但配置文件中參數項很少,手動修改/etc/my.cnf文件如下: [client] #password = ...
環境:CentOS6.4+MySQL5.6.39
Case復現:
源碼安裝MySQL5.6.39,不修改配置文件初始化後啟動mysql,此時服務正常啟動且已產生配置文件/etc/my.cnf,但配置文件中參數項很少,手動修改/etc/my.cnf文件如下:
[client]
#password = your_password
port = 3306
socket = /opt/mysql/databases/mysql.sock
[mysqld]
port = 3306
socket = /opt/mysql/databases/mysql.sock
skip-external-locking
skip_name_resolve
key_buffer_size = 32M
max_allowed_packet = 32M
table_open_cache = 1024
sort_buffer_size = 4M
read_buffer_size = 8M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
bulk_insert_buffer_size = 64M
tmp_table_size = 32M
max_heap_table_size = 32M
thread_cache_size = 1000
query_cache_size = 0
query_cache_type = 0
max_connections=1000
max_connect_errors = 1000000
sync_binlog = 100
long_query_time = 2
slow_query_log_file = /opt/mysql/databases/mysql-slow_3306.log #該參數與5.5版本有區別
datadir = /opt/mysql/databases
log_error=/opt/mysql/databases/error.log
pid-file=/opt/mysql/databases/mysql.pid
log-bin=mysql-bin
binlog_format=rows
server-id = 1
innodb_write_io_threads = 8
innodb_read_io_threads = 8
innodb_open_files = 65535
innodb_flush_method = O_DIRECT
innodb_max_dirty_pages_pct=50
innodb_file_per_table = 1
innodb_flush_log_at_trx_commit=2
innodb_log_buffer_size = 32M
innodb_log_files_in_group = 2
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
然後重新啟動mysql服務報錯: ERROR! The server quit without updating PID file (/opt/mysql/databases/mysql.pid). 但mysql錯誤日誌卻沒有記錄任何錯誤信息。
解決辦法:重新初始化mysql
cd /opt/mysql/scripts
./mysql_install_db --user=mysql --basedir=/opt/mysql --datadir=/opt/mysql/databases/
重啟mysql服務,啟動成功。