安装完mysql后,运行和修改密码出错:

由 chinadoudou 在 10-26-2002 11:52 发表:

安装完mysql后,运行和修改密码出错:

[root@Server bin]# ./safe_mysqld --user=mysql

Starting mysqld daemon with databases from /usr/local/mysql/var

021026 11:59:21 mysqld ended

[root@Server bin]# /usr/local/mysql/bin/mysqladmin -u root -p password 123456

Enter password:

/usr/local/mysql/bin/mysqladmin: connect to server at 'localhost' failed

error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)'

Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!

[root@Server bin]#

请问是怎么回事呢?


由 yghanzi 在 10-28-2002 17:27 发表:


我也想问同样的问题:

配置如下:

Rh8.0

Apache1.3.25

Mysql3.23.52

[root@Server bin]# ./safe_mysqld --user=mysql

Starting mysqld daemon with databases from

1<font color="red">/var/lib/mysql</font>

021026 11:59:21 mysqld ended

[root@Server bin]# /usr/local/mysql/bin/mysqladmin -u root -p password 123456

Enter password:

/usr/local/mysql/bin/mysqladmin: connect to server at 'localhost' failed

error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock'

1<font color="red">(2)</font>

'

Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!

[root@Server bin]#


由 yghanzi 在 10-28-2002 17:36 发表:


多谢


由 sd44 在 10-28-2002 20:27 发表:


1,mysql自动关闭是因为权限的问题

groupadd mysql

useradd -g mysql mysql

chown -R root /usr/local/mysql (mysql安装路径,随个人情况)

chown -R mysql /usr/local/mysql/var (mysql数据库存储地址)

chgrp -R mysql /usr/local/mysql

2,打开mysql服务,再修改密码


由 yghanzi 在 10-29-2002 11:43 发表:


问题解决了:

到suport-files 目录下有几个.cnf 文件,挑一个,

(我的suport-files是/usr/local/mysql/share/mysql )

cp my-medium.cnf /etc/my.cnf

然后修改 /etc/my.cnf ,问题就在这里头了: 我们直杀mysqld 那个节(mysql.server和safe_mysqld我没改)

[mysqld]

port = 8888 (MySQL 缺省的端口是 3306 ,为了安全)

log = /var/log/mysql.log

basedir = /var/log/mysql

socket = /var/log/mysql/mysql.sock

实际上你查看mysqld.log时,那里面就有很详细说明,不信你去看看,可能与我的不同但一定可以在里面找到答案;)终于搞定了GoOn!

楼主:

你试试这样

[mysqld]

port = 8888 (MySQL 缺省的端口是 3306 ,为了安全)

log = /usr/local/mysql/var/mysql.log

basedir = /usr/local/mysql/var

socket = /usr/local/mysql/var/mysql.sock


由 chinadoudou 在 10-29-2002 15:13 发表:

多谢!

:)


由 闪光 在 11-18-2002 12:02 发表:


> quote: > > * * * > > 最初由 yghanzi

Published At
Categories with 服务器类
Tagged with
comments powered by Disqus