|
首先、检查宝塔面板MySQL无法启动(自动停止)出错原因:- wget -O sql-repair.sh http://download.bt.cn/install/sql-repair.sh && sh sql-repair.sh
复制代码 然后、宝塔面板 /etc/my.cnf 的设置内容(MySQL 5.6 my.cnf 的设置内容):
- [client]
- #password= your_password
- port= 3306
- socket= /tmp/mysql.sock
复制代码- [mysqld]port = 3306socket = /tmp/mysql.sockdatadir = /www/server/datadefault_storage_engine = MyISAM#skip-external-locking#loose-skip-innodbkey_buffer_size = 8Mmax_allowed_packet = 1Mtable_open_cache = 32sort_buffer_size = 256Knet_buffer_length = 4Kread_buffer_size = 128Kread_rnd_buffer_size = 256Kmyisam_sort_buffer_size = 4Mthread_cache_size = 4query_cache_size = 4Mtmp_table_size = 8Msql-mode=NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTIO
- #skip-networking#skip-name-resolvemax_connections = 500max_connect_errors = 100open_files_limit = 65535
- log-bin=mysql-binbinlog_format=mixedserver-id = 1expire_logs_days = 10
- default_storage_engine = InnoDBinnodb_data_home_dir = /www/server/datainnodb_data_file_path = ibdata1:10M:autoextendinnodb_log_group_home_dir = /www/server/datainnodb_buffer_pool_size = 16Minnodb_additional_mem_pool_size = 2Minnodb_log_file_size = 5Minnodb_log_buffer_size = 8Minnodb_flush_log_at_trx_commit = 1innodb_lock_wait_timeout = 50
- [mysqldump]quickmax_allowed_packet = 16M
- [mysql]no-auto-rehash
- [myisamchk]key_buffer_size = 20Msort_buffer_size = 20Mread_buffer = 2Mwrite_buffer = 2M
- [mysqlhotcopy]interactive-timeout
复制代码 最后、用下面的命令代码生效一下:
- /www/server/mysql/scripts/mysql_install_db --defaults-file=/www/server/mysql/my.cnf --basedir=/www/server/mysql --datadir=/www/server/data/ --user=mysql
复制代码
|
|