LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1325|回复: 18

请问有谁在SUSE SLES9下面成功安装了mysql??

[复制链接]
发表于 2004-8-31 12:02:14 | 显示全部楼层 |阅读模式
我的装完启动不了,总是找不到mysql.sock的问题,求救啊!
发表于 2004-8-31 12:57:38 | 显示全部楼层
实际不是这样的,你需要先修改 mysql 的密码,不然的话
mysql 是不会被正确使用的!!! 修改后就一切正常了
 楼主| 发表于 2004-9-1 08:32:15 | 显示全部楼层
可是我修改不了密码啊!用
#mysqladmin -u root password 'mysql'
也提示找不到mysql.sock
继续郁闷中!求助!
 楼主| 发表于 2004-9-1 11:45:44 | 显示全部楼层
着急等待中,盼回复!
发表于 2004-9-1 23:58:01 | 显示全部楼层
奇怪
发表于 2004-9-2 00:02:40 | 显示全部楼层

解决不能通过mysql.sock连接MySQL问题的办法

引用以下联接:
http://www.21php.com/tutorial/tutorial.php?tid=41
[PHP]加入日期:2003年05月31日 03:33:20 AM 作者:Djzhi 中文PHP论坛
这个问题主要提示是,不能通过'/tmp/mysql.sock'连到服务器,而php标准配置正是用过'/tmp/mysql.sock',但是一些 mysql安装方法将mysql.sock放在/var/lib/mysql.sock或者其他的什么地方,你可以通过修改/etc/my.cnf文件来修正它,打开文件,可以看到如下的东东:
[mysqld]
socket=/var/lib/mysql.sock
改一下就好了,但也会引起其他的问题,如mysql程序连不上了,再加一点:
[mysql]
socket=/tmp/mysql.sock
或者还可以通过修改php.ini中的配置来使php用其他的mysql.sock来连,这个大家自己去找找

或者用这样的方法:
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

还有:
phpmyadmin的说明书有说
The error message "Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)..." is displayed. What can I do?

For RedHat users, Harald Legner suggests this on the mailing list:

On my RedHat-Box the socket of mysql is /var/lib/mysql/mysql.sock. In your php.ini you will find a line
mysql.default_socket = /tmp/mysql.sock
change it to
mysql.default_socket = /var/lib/mysql/mysql.sock
Then restart apache and it will work.

Here is a fix suggested by Brad Ummer in the phpwizard forum:

First, you need to determine what socket is being used by MySQL.
To do this, telnet to your server and go to the MySQL bin directory. In this directory there should be a file named mysqladmin. Type ./mysqladmin variables, and this should give you a bunch of info about your MySQL server, including the socket (/tmp/mysql.sock, for example).
Then, you need to tell PHP to use this socket.
Assuming you are using PHP 3.0.10 or better, you can specify the socket to use when you open the connection. To do this in phpMyAdmin, you need to complete the socket information in the config.inc.php3.
For example: $cfg['Servers'][$i]['socket'] = '/tmp/mysql.sock';
[/PHP]
 楼主| 发表于 2004-9-2 09:26:22 | 显示全部楼层
我得提示就是找不到/var/lib/mysql/mysql.sock ,tmp下面也没有这个文件!所以才郁闷中!
发表于 2004-9-2 10:55:54 | 显示全部楼层
这是目录的权限问题,我以前也碰到过的
不过好久没用了,记不大清楚具体是哪个目录了……
好像是/var/mysql吧,不知道对不对
 楼主| 发表于 2004-9-2 11:09:14 | 显示全部楼层
哦!一会我去看看是不是权限问题!
 楼主| 发表于 2004-9-6 08:41:04 | 显示全部楼层
不行,不是权限的问题!依然不可以的!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表