发布于 2014-12-06 08:52:00 | 485 次阅读 | 评论: 1 | 来源: PHPERZ

这里有新鲜出炉的Mysql教程,程序狗速度看过来!

Mysql关系型数据库管理系统

MySQL是一个开放源码的小型关联式数据库管理系统,开发者为瑞典MySQL AB公司。MySQL被广泛地应用在Internet上的中小型网站中。由于其体积小、速度快、总体拥有成本低,尤其是开放源码这一特点,许多中小型网站为了降低网站总体拥有成本而选择了MySQL作为网站数据库。


本文为大家讲解的是mysql错误:Can't connect to local MySQL server through socket解决方法,感兴趣的同学参考下。

错误描述:

连接mysql报找不到sock 错误如下 :

[root@app60 mysqld]#  /usr/bin/mysql -uroot -p
Enter password: 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
[root@app60 mysqld]# 

错误原因:

mysql找不到mysql.sock的位置,比如在安装时mysql.sock的位置不是在默认目录下。

解决方法:

登陆的时候加上sock参数就OK了。

[root@app60 mysqld]#  /usr/bin/mysql -uroot -p --socket=/opt/mysqldata/mysql.sock
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.1.69 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 
 



最新网友评论  共有(1)条评论 发布评论 返回顶部
kzqgagt 发布于2016-08-13 16:45:39
垃圾
支持(0)  反对(0)  回复

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务