LinuxSir.cn,穿越时空的Linuxsir!

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

运行MYSQL时的错误,请大家帮着分析一下。

[复制链接]
发表于 2003-6-19 16:01:01 | 显示全部楼层 |阅读模式
./mysqladmin -u root -p ""
Enter password:
./mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!

./mysqldump --databases DB1
./mysqldump: Got error: 2002: Can't connect to local MySQL server through socket socket '/tmp/mysql.sock' (2)'
'/tmp/mysql.sock' (2) when trying to connect

执行很多命令的时候都提示什么?Can't connect to local MySQL server through sockesocket '/tmp/mysql.sock' (2)'

请问这是为什么。

还有/tmp/下面要本就没有这个文件夹和文件,mysql.sock 是在/var/lib/mysql的目录,文件属性中有个“S”请问这个“S”表是什么属性?:help :help
发表于 2003-6-19 16:11:30 | 显示全部楼层
'/tmp/mysql.sock'看看这个文件有没有
ps -ef|grep mysql
看看有无进程
如果其他地方有mysql.sock把它拷贝到tmp下看看
 楼主| 发表于 2003-6-19 16:19:11 | 显示全部楼层
有这个文件。在/var/lib/mysql/目录下呢。
但拷贝不了,下面是提示:
[root@QCY mysql]# cp mysql.sock /tmp/mysql/
cp: cannot open `mysql.sock' for reading: No such device or address

我用ln -s /var/lib/mysql/mysql.sock /tmp/mysql/mysql.sock 这样做了,但还是有问题。
发表于 2003-6-19 16:22:28 | 显示全部楼层
'/tmp/mysql.sock'
看仔细!/tmp下。不是/tmp/mysql下……
 楼主| 发表于 2003-6-19 16:40:42 | 显示全部楼层
谢谢,我已经改过来了,不过还是有错误提示
/mysqladmin -u root -p "test123"
Enter password:
./mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: YES)'
发表于 2003-6-19 16:44:28 | 显示全部楼层
还是ps -ef|grep mysql
看看mysql进程起了没。
如果起了的话那可能是另外的问题再说
没起,在mysql目录下的某个目录找到mysql.server
在改目录下运行./mysql.server start看能不能起来。
如果不行,你还是贴错误提示。
 楼主| 发表于 2003-6-19 16:52:14 | 显示全部楼层
[root@QCY bin]# ps -ef |grep mysql
root       950   896  0 14:59 pts/0    00:00:00 /bin/sh /usr/bin/safe_mysqld
mysql      966   950  0 14:59 pts/0    00:00:06 /usr/sbin/mysqld --basedir=/ --droot      1221   896  0 16:48 pts/0    00:00:00 grep mysql
[root@QCY bin]#
搜到以上结果,MYSQL应该是启动了吧
发表于 2003-6-19 16:57:58 | 显示全部楼层
到mysql的bin目录下./mysql -u root -p
你看看进的去么
 楼主| 发表于 2003-6-19 18:12:11 | 显示全部楼层
还是行不。下面是错误提示。(给你添麻烦了,我是第一次安装MYSQL所以有很的问题)
ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)
 楼主| 发表于 2003-6-19 18:54:40 | 显示全部楼层
我找到一点资料,上面说MSQL安装是没有密码的,用
./mysql -u root passwore "new-password" 来更改密码 其中“new-password"是你输入的新密码;
而:下面我想是访问被拒绝(因为输入密码错误)
/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: YES)'
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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