在新安装mysql后进行启动发现报错
mysql启动服务命令
Starting mysqld (via systemctl):? Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld3306.service" and "journalctl -xe" for details.
按照错误提示信息进行排查
systemctl status mysqld3306.service
journalctl -xe
尝试连接mysql报错查看sock文件夹发现sock文件丢失
[[email protected] mysqldata3309]# mysql -uroot -S /data/mysqldata3309/sock/mysql.sock -p"Ygadb(vw<6ae"
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/data/mysqldata3309/sock/mysql.sock‘ (2)