Can't connect to local MySQL server through socket '/tmp/mysql.sock'
2023-09-27 14:24:15 时间
跟着linux安装MySQL教程做的时候,执行到
./bin/mysqladmin -u root password 123456
mysql报错
错误:'Can't connect to local MySQL server through socket '/tmp/mysql.sock'
通过本地ip直接回车可以登录
mysql -uroot -h 127.0.0.1 -p
网上查找资料后发现是MySQL没有找到这个文件,bug吗?
>find / -name mysql.sock
/var/lib/mysql/mysql.sock
原来这文件在这里,MySQL自己创建的文件,自己不知道在哪里,给你跪了,给它做个软连接,告诉他文件地址
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
再执行开头的语句,就成功了
参考
亲测有效,解决Can 't connect to local MySQL server through socket '/tmp/mysql.sock '(2) ";
相关文章
- MySQL Study之--Percona Server版本号
- Neor Profile SQL is the solution for developers wanting to profile the MySQL queries. This software allows the tracking of all queries to MySQL server from your application or website.
- mysql中/*!40000 DROP DATABASE IF EXISTS `top_server`*/;这中注释有什么作用?
- Mysql连接错误:Lost connection to Mysql server at 'waiting for initial communication packet'
- 解决ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost:3306' (10061)问题
- is not allowed to connect to this mysql server
- cant connect to mysql server on
- Host is not allowed to connect to this MySQL server解决方法
- 【mysql问题】解决2003-Can‘t connect to MySQL server on ‘ ‘(10060“Unknown error“)
- sqlyog Can't connect to MySQL server on localhost (0)
- Can't connect to MySQL server on localhost (10061)解决方法
- ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061),mysql服务已启动
- 我的winows server 2012 突然多了个piress的帐户,后来一查原来是mysql漏洞的问题,郁闷
- 在centos中php 在连接mysql的时候,出现Can't connect to MySQL server on 'XXX' (13)
- ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var mysql (转)
- message from server: “Host is not allowed to connect to this MySQL server“解决办法
- MySQL建立双向主备复制server配置方法
- (3.4)mysql基础深入——mysql.server启动脚本源码阅读与分析
- [解决方法]MySql提示:The server quit without updating PID file(…)失败
- Mysql与Redis的同步实践
- sql server 表2字段更新到表1,mysql
- Navicat连接数据库出现 is not allowed to connect to this MySQL server 报错