Mysql指定配置文件时启动报错,解决办法
2019-04-10 本文已影响0人
条子在洗澡
--[root@192 bin]# ./mysqld_safe --datadir=/export/Data/mysql/data/ --pid-file=/export/Data/mysql/data/192.168.147.128.pid --basedir=/export/servers/mysql/ --defaults-file=/export/servers/mysql/etc/my.cnf &
[1] 29196
[root@192 bin]# 160903 18:03:01 mysqld_safe Logging to '/export/Data/mysql/data//192.168.147.128.err'.
160903 18:03:01 mysqld_safe Starting mysqld daemon with databases from /export/Data/mysql/data/
160903 18:03:03 mysqld_safe mysqld from pid file /export/Data/mysql/data/192.168.147.128.pid ended
启动mysql时报错,在日志中显示:
2016-09-03 18:03:01 29310 [ERROR] /export/servers/mysql/bin/mysqld: unknown variable 'defaults-file=/export/servers/mysql/etc/my.cnf'
2016-09-03 18:03:01 29310 [ERROR] Aborting
当使用如下方式启动时:可以正常启动:mysql的--default-file 必须紧跟mysqld_safe其后;
环境centos7 mysql5.6
[root@192 bin]# ./mysqld_safe --defaults-file=/export/servers/mysql/etc/my.cnf --datadir=/export/Data/mysql/data/ --pid-file=/export/Data/mysql/data/192.168.147.128.pid --basedir=/export/servers/mysql/ &
这个是mysql的一个bug,--defaults-file必须是第一个参数