`
luozhonghua2014
  • 浏览: 62573 次
文章分类
社区版块
存档分类
最新评论

error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'

 
阅读更多
[root@luozhonghua ~]# /usr/bin/mysqladmin -u root password 'aaaaaa'
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
解决:
1》/etc/rc.d/init.d/mysqld status 看看mysql是否已经启动
2》service mysqld start
分享到:
评论

相关推荐

    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'

    在MySQL服务器的运行过程中,可能会遇到“ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'”这样的错误。这个错误提示表明,客户端试图通过Unix域套接字(socket文件)...

    Can’t connect to local MySQL through socket ‘/tmp/mysql.sock’解决方法

    ERROR 2002: Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (111) 解决办法: /usr/local/mysql/bin/mysqladmin -u root > -S /var/lib/mysql/mysql.sock password 'your.passwd' ...

    ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’

    在使用MySQL时,可能会遇到一个常见的错误:“ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’”。这个错误表明客户端无法通过Unix套接字文件与本地MySQL服务器建立...

    Linux无法登录数据库并且报错2002

    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)

    mysql中异常错误ERROR:2002的解决方法

    在MySQL的使用过程中,有时会遇到异常错误"ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)"。这个错误通常表示客户端无法通过套接字文件与MySQL服务器...

    linux下启动mysql服务

    当遇到类似 `ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)` 的错误时,可以通过以下两种方式解决: - 使用 `mysqladmin` 设置 root 用户密码并指定正确的 socket ...

    Linux架设支持Mysql的动态Web服务器[参考].pdf

    在启动 Mysql 时,可能会出现“ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)”错误。这是因为 /var/lib/mysql 目录的权限不允许 Mysql 服务访问。解决方法是:...

    Linux AS4下安装安装mysql

    如果你遇到“ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)”的错误,可以尝试以下解决方案: 1. 检查MySQL服务是否已启动:`# /etc/rc.d/init.d/...

    centos7安装mysql文档以及mysql安装包

    #### 问题一:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' - **原因**:通常是 MySQL 服务没有启动导致的。 - **解决办法**:执行命令`service mysql start`来启动 ...

    CentOS7.2.1521下安装MySQL

    如果出现 `ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)` 错误,这是因为 `/var/lib/mysql` 目录的权限问题。解决方法是更改目录的所有权: ```bash...

    linunx安装mysql(超详细)

    - 可能会出现连接失败的情况,错误信息为“ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)”。此时,需要检查`/etc/my.cnf`文件中的`socket`配置项,确保与实际...

    centos 7.1 mysql5.7.12常见问题解决

    问题 2:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) 该问题是关于 MySQL 服务无法启动的问题。解决方法是杀死 MySQL 进程,启动 MySQL 服务,并...

    mysql忘记密码怎么办

    首先,当你尝试用`mysql -uroot -p`命令登录MySQL,并输入密码后,如果出现`ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)`的错误,这通常意味着MySQL...

    【怎么在linux下安装mysql数据库并配置的方法】.docx

    5. 如果在尝试连接MySQL时遇到`ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)`的错误,可能是因为MySQL服务尚未启动。确保使用上述命令启动了服务。 6...

    mysql的配置与安装

    如果在配置过程中遇到错误提示“ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'”,可以尝试以下命令来解决: ```bash [root@localhost ~]# ln -s /var/lib/mysql/...

    阿里云centos7mysql tomcat 配置

    如果遇到 `ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)` 错误,可能是权限问题导致。 ```bash sudo chown -R openscanner:openscanner /var/lib/...

    mysql启动报错MySQL server PID file could not be found

    同时,如果你试图通过命令行连接到本地MySQL服务器,可能会收到类似于“Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)”的错误,这表明MySQL服务器的套接字文件也未找到或...

    11.记录集群启动过程及运行过程遇到的问题1

    在启动 Hive 时,可能会遇到 `ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)` 的错误。这是因为 MySQL 服务器没有启动,需要先启动 MySQL 服务器,...

    mysql服务启动却连接不上的解决方法

    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) root@localhost:~# service mysqld restart Shutting down MySQL.. [ OK ] Starting MySQL.

Global site tag (gtag.js) - Google Analytics