二进制安装mysql 5.7.31 启动报错/etc/init.d/mysqld: line 239: my_print_defaults: command not found

[root@centos7 ~]#service mysqld start
/etc/init.d/mysqld: line 239: my_print_defaults: command not found
/etc/init.d/mysqld: line 259: cd: /usr/local/mysql: No such file or directory
Starting MySQL ERROR! Couldn't find MySQL server (/usr/local/mysql/bin/mysqld_safe)

解决办法:

# vi /etc/my.cnf    (指明basedir和datadir路径即可)

basedir=/usr/local/mysql
datadir=/data/mysql

[root@centos7 ~]#service mysqld start
Starting MySQL. SUCCESS!

posted @ 2020-09-13 18:43  無心的Man  阅读(12324)  评论(0编辑  收藏  举报