1.指定mysql启动的配置文件mysqld --defaults-file=/etc/my.cnf --user=root,这里指定的 /etc/my.cnf文件 2重启mysql 其他解决方案: 1.my.cnf修改文件权限为644