[root@b28-new-5-53 log]# service mysql start
Starting MySQL.......................................................................................................................................................................................................................................................................................................................................................^C
报错如下:
180615 14:38:22 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
180615 14:38:22 [ERROR] /usr/sbin/mysqld: unknown variable 'thread_pool_high_prio_mode=none'
180615 14:38:22 [ERROR] Aborting
180615 14:38:22 [Note] InnoDB: FTS optimize thread exiting.
180615 14:38:22 [Note] InnoDB: Starting shutdown...
180615 14:38:25 [Note] InnoDB: Shutdown completed; log sequence number 1600638
180615 14:38:25 [Note] /usr/sbin/mysqld: Shutdown complete
[root@b28-new-5-53 log]# rpm -qa |grep Mar
MariaDB-compat-10.0.12-1.el6.x86_64
MariaDB-shared-10.0.12-1.el6.x86_64
MariaDB-common-10.0.12-1.el6.x86_64
MariaDB-devel-10.0.12-1.el6.x86_64
MariaDB-server-10.0.12-1.el6.x86_64
MariaDB-client-10.0.12-1.el6.x86_64
没有少安装包
[root@b28-new-5-53 log]# mysql --version
mysql Ver 15.1 Distrib 10.0.12-MariaDB, for Linux (x86_64) using readline 5.1
[root@b28-new-5-53 log]# ls -lstr
total 1310732
0 -rw-rw---- 1 mysql mysql 0 Jun 15 14:21 mysql-bin.index
262144 -rw-rw---- 1 mysql mysql 268435456 Jun 15 14:21 ib_logfile1
262144 -rw-rw---- 1 mysql mysql 268435456 Jun 15 14:21 ib_logfile2
262144 -rw-rw---- 1 mysql mysql 268435456 Jun 15 14:21 ib_logfile3
262144 -rw-rw---- 1 mysql mysql 268435456 Jun 15 14:22 ib_logfile0
262148 -rw-rw---- 1 mysql mysql 268435456 Jun 15 14:22 ibdata1
8 -rw-rw---- 1 mysql mysql 4659 Jun 15 14:22 mysql.err
[root@b28-new-5-53 log]# cd /my/data/
[root@b28-new-5-53 data]# ls -lstr
total 28
4 drwx------ 2 mysql root 4096 Jun 15 14:21 mysql
4 drwx------ 2 mysql root 4096 Jun 15 14:21 test
4 -rw-rw---- 1 mysql mysql 52 Jun 15 14:22 aria_log_control
16 -rw-rw---- 1 mysql mysql 16384 Jun 15 14:22 aria_log.00000001
[root@b28-new-5-53 data]# chown -R mysql.mysql /my
[root@b28-new-5-53 data]# ls -lstr
total 28
4 drwx------ 2 mysql mysql 4096 Jun 15 14:21 mysql
4 drwx------ 2 mysql mysql 4096 Jun 15 14:21 test
4 -rw-rw---- 1 mysql mysql 52 Jun 15 14:22 aria_log_control
16 -rw-rw---- 1 mysql mysql 16384 Jun 15 14:22 aria_log.00000001
改完data目录的权限后,发现还是无法正常启动MySQL服务,
于是从另外一台正常运行的mariadb上拷贝已了一份配置文件,如下是配置文件的内容:
[client]
port = 3306
socket = /my/log/mysql.sock
password = 123
user = root
[mysql]
default-character-set = utf8
[mysqld]
# file
datadir = /my/data
pid-file= /my/log/mysql.pid
log_error=/my/log/mysql.err
port = 3306
socket = /my/log/mysql.sock
character_set_server = utf8
#skip-grant-tables
slow_query_log = 1
slow_query_log_file = /my/log/slowq.log
long_query_time = 1
# temp
max_tmp_tables = 64
max_heap_table_size = 1G
tmp_table_size = 512M
slave_load_tmpdir = /my/log
tmpdir = /my/log
# session
back_log = 8192
skip-name-resolve
max_allowed_packet = 32M
max_connections = 16000
max_connect_errors = 10000
wait_timeout = 28800
binlog_cache_size = 1M
table_open_cache = 1024
thread_concurrency = 24
thread_cache_size = 512
thread_handling = pool-of-threads
#thread_pool_high_prio_mode = none 结合上面/my/log/mysql.err文件中的报错,出现无法启动服务的原因是之前的配置文件中把这行的参数没注释掉
thread_pool_idle_timeout = 28800
thread_pool_oversubscribe = 20
#max_statement_time = 5000
query_cache_type = 0
query_cache_size = 0
key_buffer_size = 16M
myisam_sort_buffer_size = 8M
read_buffer_size = 8M
read_rnd_buffer_size = 8M
sort_buffer_size = 8M
join_buffer_size = 8M
# innodb
default_storage_engine = InnoDB
innodb_data_home_dir = /my/log
innodb_data_file_path=ibdata1:256M:autoextend
innodb_log_group_home_dir = /my/log
innodb_log_files_in_group = 4
innodb_log_file_size = 256M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 2
innodb_flush_method = O_DIRECT
innodb_lock_wait_timeout = 50
#innodb_thread_concurrency = 24 16
innodb_buffer_pool_size = 3G
innodb_additional_mem_pool_size = 20M
innodb_io_capacity = 1500
innodb_use_native_aio = 1
innodb_file_per_table = 1
innodb_open_files = 3000
innodb_print_all_deadlocks = 1
# others
#memlock = 1
performance_schema = 0
# replication
server-id = 553
log-bin = /my/log/mysql-bin
#binlog-ignore-db=mysql
binlog_format = row
expire_logs_days = 7
relay_log = /my/log/relay-bin
#replicate_ignore_db = mysql
#slave_skip_errors = 1062
#skip-slave-start
read_only = 1
#sync_binlog = 1
log_slave_updates = 1
g.log_slave_updates = 0
g.replicate_wild_ignore_table = mysql.%
[mysqldump]
default-character-set = utf8
/etc/init.d/mysql start 启动成功