解决方法 :给予权限,执行 “chown -R mysql.mysql /opt/mysql/data” 然后重新启动mysqld
解决方法:用命令“ps -ef|grep mysqld”查看是否有mysqld进程,如果有使用“kill -9 进程号”杀死,然后重新启动mysqld!
解决方法:去mysql的二进制日志目录看看,如果存在mysql-binlog.index,就赶快把它删除掉吧
解决方法:请在[mysqld]下设置这一行:datadir = /opt/mysql/data
解决方法:检查一下/etc/my.cnf文件中有没有没被注释掉的skip-federated字段,如果有就立即注释掉吧。
解决方法:使用“chown” “chmod”命令赋予mysql所有者及权限
12解决方法:先临时改为警告模式:[root@www php]# setenforce 0然后打开/etc/sysconfig/selinux,把SELINUX=enforcing改为SELINUX=disabled
1[root@db01 mysql]# chown -R mysql.mysql …/mysql
最好是整个mysql程序目录都授权予mysql用户。
经验之谈:
还有一个原因可能是:
查看配置文件/usr/local/mysql/my.cnf里有没有innodb_buffer_pool_size这个参数
innodb_buffer_pool_size:主要作用是缓存innodb表的索引,数据,插入数据时的缓冲;
默认值:128M;
专用mysql服务器设置此值的大小: 系统内存的70%-80%最佳。
如果你的系统内存不大,查看这个参数,把它的值设置小一点吧
在配置文件/etc/my.cnf添加错误日志参数,一切问题都解决
12[mysqld_safe]log-error = /data/mysql/logs/error.log
启动报错时查看日志信息:
12345678910111213141516171819202122232425262728#tail -f /data/mysql/logs/error.log 160721 06:12:07 mysqld_safe Starting mysqld daemon with databases from /data/mysql/data2016-07-21 06:12:10 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).2016-07-21 06:12:10 0 [Note] /opt/mysql/bin/mysqld (mysqld 5.6.27-log) starting as process 2290 …2016-07-21 06:12:10 2290 [Note] Plugin ‘FEDERATED’ is disabled.2016-07-21 06:12:10 2290 [Warning] The option innodb (skip-innodb) is deprecated and will be removed in a future release2016-07-21 06:12:10 2290 [Note] InnoDB: Using atomics to ref count buffer pool pages2016-07-21 06:12:10 2290 [Note] InnoDB: The InnoDB memory heap is disabled2016-07-21 06:12:10 2290 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins2016-07-21 06:12:10 2290 [Note] InnoDB: Memory barrier is not used2016-07-21 06:12:10 2290 [Note] InnoDB: Compressed tables use zlib 1.2.32016-07-21 06:12:10 2290 [Note] InnoDB: Using CPU crc32 instructions2016-07-21 06:12:10 2290 [Note] InnoDB: Initializing buffer pool, size = 128.0M2016-07-21 06:12:10 2290 [Note] InnoDB: Completed initialization of buffer pool2016-07-21 06:12:10 2290 [Note] InnoDB: Highest supported file format is Barracuda.2016-07-21 06:12:11 2290 [Note] InnoDB: 128 rollback segment(s) are active.2016-07-21 06:12:11 2290 [Note] InnoDB: Waiting for purge to start2016-07-21 06:12:11 2290 [Note] InnoDB: 5.6.27 started; log sequence number 16259972016-07-21 06:12:11 2290 [ERROR] /opt/mysql/bin/mysqld: unknown option '–slave_parallel_workers=3’2016-07-21 06:12:11 2290 [ERROR] Aborting2016-07-21 06:12:11 2290 [Note] Binlog end2016-07-21 06:12:11 2290 [Note] Shutting down plugin 'partition’2016-07-21 06:12:11 2290 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES’2016-07-21 06:12:11 2290 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES’2016-07-21 06:12:11 2290 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS’2016-07-21 06:12:11 2290 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN’2016-07-21 06:12:11 2290 [Note] Shutting down plugin ‘INNODB_SYS_FIELDS’
发现日志输出
122016-07-21 06:12:11 2290 [ERROR] /opt/mysql/bin/mysqld: unknown option '–slave_parallel_workers=3’2016-07-21 06:12:11 2290 [ERROR] Aborting
肯定是配置文件里加入了这个错误参数,去掉即可
新加报错:
Starting MySQL.171019 10:11:54 mysqld_safe error: log-error set to ‘/data/tools/mysql/logs/error.log’, however file don’t exists. Create writable for user ‘mysql’.
这是在mysql新版本:5.6.35,5.6.36的一个bug
参考:https://bugs.mysql.com/bug.php?id=84427
解决:
手动创建日志文件:
12345touch /data/tools/mysql/logs/error.log chown mysql. /data/tools/mysql/logs/error.log /etc/init.d/mysqld start
转自http://732233048.blog.51cto.com/9323668/1636409,版权归作者所有。