2017-01-19T07:20:22.148636Z 0 [ERROR] unknown variable ‘defaults-file=/Users/wenzg/local/mysql/my.cnf’
2017-01-19T07:20:22.148666Z 0 [ERROR] Aborting
mysql的error log中始终报这个错误,开始以为是其它什么错误,其实主要是由于参数的位置不同。
报错的启动命令:
/Users/wenzg/local/mysql/bin/mysqld --user=mysql --defaults-file=/Users/wenzg/local/mysql/my.cnf --basedir=/Users/wenzg/local/mysql/ --datadir=/Users/wenzg/local/mysql/data/ --plugin-dir=/Users/wenzg/local/mysql//lib/plugin --log-error=/Users/wenzg/local/mysql/data//local-dev.err --pid-file=/Users/wenzg/local/mysql/data/local-dev.pid --socket=/Users/wenzg/local/mysql/tmp/mysql.sock --port=7777
解决方法:
/Users/wenzg/local/mysql/bin/mysqld --defaults-file=/Users/wenzg/local/mysql/my.cnf --basedir=/Users/wenzg/local/mysql/ --datadir=/Users/wenzg/local/mysql/data/ --plugin-dir=/Users/wenzg/local/mysql//lib/plugin --user=mysql --log-error=/Users/wenzg/local/mysql/data//local-dev.err --pid-file=/Users/wenzg/local/mysql/data/local-dev.pid --socket=/Users/wenzg/local/mysql/tmp/mysql.sock --port=7777