安装:https://blog.mrabit.com/details/29
port = 3360
datadir=/jzim/data_mysql/mysql #/var/lib/mysql
socket=/jzim/data_mysql/mysql/mysql.sock
保存,重启服务,mysql -u root -p 登录出现如下问题
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)
解决:
修改/etc/my.cnf
添加以下内容到/etc/my.conf:
[client]
socket = /Data/mydata/mysql.sock
[mysqld]
socket = /Data/mydata/mysql.sock
重启服务,OK
参考:https://blog.csdn.net/u013631121/article/details/80875837