[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
分享到:
相关推荐
在MySQL服务器的运行过程中,可能会遇到“ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'”这样的错误。这个错误提示表明,客户端试图通过Unix域套接字(socket文件)...
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' ...
在使用MySQL时,可能会遇到一个常见的错误:“ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’”。这个错误表明客户端无法通过Unix套接字文件与本地MySQL服务器建立...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
在MySQL的使用过程中,有时会遇到异常错误"ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)"。这个错误通常表示客户端无法通过套接字文件与MySQL服务器...
当遇到类似 `ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)` 的错误时,可以通过以下两种方式解决: - 使用 `mysqladmin` 设置 root 用户密码并指定正确的 socket ...
在启动 Mysql 时,可能会出现“ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)”错误。这是因为 /var/lib/mysql 目录的权限不允许 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/...
#### 问题一:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' - **原因**:通常是 MySQL 服务没有启动导致的。 - **解决办法**:执行命令`service mysql start`来启动 ...
如果出现 `ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)` 错误,这是因为 `/var/lib/mysql` 目录的权限问题。解决方法是更改目录的所有权: ```bash...
- 可能会出现连接失败的情况,错误信息为“ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)”。此时,需要检查`/etc/my.cnf`文件中的`socket`配置项,确保与实际...
问题 2:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) 该问题是关于 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...
5. 如果在尝试连接MySQL时遇到`ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)`的错误,可能是因为MySQL服务尚未启动。确保使用上述命令启动了服务。 6...
如果在配置过程中遇到错误提示“ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'”,可以尝试以下命令来解决: ```bash [root@localhost ~]# ln -s /var/lib/mysql/...
如果遇到 `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服务器,可能会收到类似于“Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)”的错误,这表明MySQL服务器的套接字文件也未找到或...
在启动 Hive 时,可能会遇到 `ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)` 的错误。这是因为 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.