C连接mysql出现错误:Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.soc
2012-03-02 18:13
701 查看
1、先通过:service mysqld status 查看mysql是否启动
(没装mysql service 也可通过 /etc/rc.d/init.d/mysqld status查看)
若没启动,则启动mysql:service mysqld start
2、方法: 修改/etc/my.conf:
[mysqld]
datadir=/usr/local/mysql/data
user=mysql
basedir=/usr/local/mysql
If there is not currently a section called [client], add one at the bottom of the file and copy the socket= line under the [mysqld] section such
as:
[client]
发现依旧如此,运行/etc/init.d/mysql start报错:Starting MySQLCouldn't find MySQL manager or server
是mysqld服务没启,运行/usr/local/mysql/bin/mysqld_safe &
(没装mysql service 也可通过 /etc/rc.d/init.d/mysqld status查看)
若没启动,则启动mysql:service mysqld start
2、方法: 修改/etc/my.conf:
[mysqld]
datadir=/usr/local/mysql/data
socket=/var/lib/mysql/mysql.sock
[mysql.server]user=mysql
basedir=/usr/local/mysql
If there is not currently a section called [client], add one at the bottom of the file and copy the socket= line under the [mysqld] section such
as:
[client]
socket=/var/lib/mysql/mysql.sock
(注意:红色标记部分文件路径必须相同)发现依旧如此,运行/etc/init.d/mysql start报错:Starting MySQLCouldn't find MySQL manager or server
是mysqld服务没启,运行/usr/local/mysql/bin/mysqld_safe &
相关文章推荐
- C连接mysql出现错误:Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.soc
- linux下mysql连接失败: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
- MySQL连接出现Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)错误
- 用命令连接mysql , 出现'mysql' is not recognized as an internal or external command错误解决
- ubuntu下连接mysql出现问题:“ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/ru”
- Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.soc
- 用命令连接mysql , 出现'mysql' is not recognized as an internal or external command错误解决
- linux学习笔记:navicate for mysql连接linux服务器上的mysql出现错误:1130 - Host'ClientIP' is not allowed to connect to
- mysql出现Duplicate entry '0' for key 'PRIMARY'的错误
- 解决Navicat for MySQL打开连接时出现错误提示1045 access denied for user 'root'@'localhost' (using password yes)的问题
- Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
- java连接linux中mysql出现:Access denied for user 'root'@'192.168.91.1' (using password: YES)
- 安装mysql5.5.20遇到cannot create directory `/var/lib/mysql': Permission denied
- JSP连接MySQL时错误:Access denied for user 'root'@'localhost' (using password: YES)'解决方案
- 用sqlyog远程连接LINUX系统的MYSQL出现了以下错误 出现1130错误
- 连接MySQL出现1045错误 解决方法
- MySQL连接报错:Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
- redhat安装pure-ftpd+mysql时出现libmysqlclient错误的解决办法
- Fedora 安装php出现错误 Cannot find libmysqlclient under /usr
- centos 下刚安装完MySQL就出现密码错误 Access denied for user 'root'