Sep 22

解决MySql问题:Can't connect to local MySQL server through socket 多云

, 08/09/22 17:54 , 技术开发 » 数据库 , 评论(0) , 引用(0) , 阅读(3613) , Via 本站原创 | |
收到一个空间,只扔了个root账号给我。然后我就来着手发布网站了。系统版本也没有说明,空间更没有配置。搞域名到发布,都比较顺利。但到了MySql这块发现问题了。
[root@localhost /]# mysql
bash: mysql: command not found 长见识了,不知道是怎么安装的。没办法,只能学习学习了。PhyMyAdmin创建好了库以后,连接网站果然不出所料,问题来了:
Warning: mysql_pconnect() [function.mysql-pconnect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
不断调查研究,发现系统的mysql.sock在tmp/mysql.sock下面。抓紧绑定一下吧,免得系统找不到!
Array
[root@localhost /]#Array
刷新页面,这个错误没有了。但又出来一个……
Warning: mysql_pconnect() [function.mysql-pconnect]: Client does not support authentication protocol requested by server; consider upgrading MySQL client
这个好理解:
由于mysql版本间的算法不同,导致的。采取官方网站的解决办法,一次搞定:
Array

[root@localhost /]# /usr/local/mysql/bin/mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 24
Server version: 5.0.45 MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> Array
Query OK, 0 rows affected (0.00 sec)

唉,这些小问题没接触过,浪费了我很多的时间,总结出来以后可以避免进弯路了。

作者:@Everyday NetLog
地址:http://log.zhoz.com/read.php?422
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!

发表评论

昵称

网址

电邮

打开HTML 打开UBB 打开表情 隐藏 记住我 [登入] [注册]