mysql Can't connect to local MySQL server through socket 问题解决
2017-11-06 10:28
246 查看
系统环境:Mac。
操作过程:使用mysql -u{用户名} -p{密码} 失败。
错误信息:
原因分析:
mysqld_safe是一个shell 脚本,会调用mysqld启动mysql服务器,并监听服务器。
如果mysqld进程异常终止,mysqld_safe将自动重启mysqld。
运行
&为后台启动。
后再次使用:
成功!
操作过程:使用mysql -u{用户名} -p{密码} 失败。
错误信息:
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 '/tmp/mysql.sock' (2)
原因分析:
1.可能mysql服务停止了。
mysqld_safe是一个shell 脚本,会调用mysqld启动mysql服务器,并监听服务器。
如果mysqld进程异常终止,mysqld_safe将自动重启mysqld。
运行
/usr/local/mysql/bin/mysqld_safe &
&为后台启动。
后再次使用:
mysql -u{用户名} -p{密码}
成功!
相关文章推荐
- 解决问题Can’t connect to local MySQL server through socket
- Can't connect to local MySQL server through socket 问题解决
- Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)问题解决
- Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)的解决问题
- MySQL 2002问题解决方案 - Can't connect to local MySQL server through socket...
- centos7下Mariadb出现Can't connect to local MySQL server through socket 问题解决
- 解决mysql启动问题: Can't connect to local MySQL server through socket '/tmp/mysql.sock'
- Can't connect to local MySQL server through socket 问题解决
- Can't connect to local MySQL server through socket 问题解决
- [转]Can't connect to local MySQL server through socket 问题解决
- 解决Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)的问题
- 解决问题Can’t connect to local MySQL server through socket
- Can't connect to 问题“local MySQL server through socket '/var/lib/mysql/mysql.sock'”解决
- Can't connect to local MySQL server through socket 问题解决
- Can't connect to local MySQL server through socket /var/lib/mysql/mysql.sock问题解决
- Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’解决方法
- Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)解决办法
- Can’t connect to local MySQL server through socket 解决办法
- Can’t connect to local MySQL server through socket 解决办法
- Can’t connect to local MySQL server through socket 解决办法