QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1658|回复: 2

安装MySQL后MySQL启动不了……

[复制链接]
发表于 2006-4-10 14:46:13 | 显示全部楼层 |阅读模式
红旗高级服务器4.1下安装MySQL出现的问题:

[root@localhost root]# cd /
[root@localhost /]# cd usr/local
[root@localhost local]# ln -s mysql-standard-5.0.19-linux-i686 mysql
[root@localhost local]# cd mysql
[root@localhost mysql]# scripts/mysql_install_db --user=mysql
Installing all prepared tables
Fill help tables

To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h localhost.localdomain password 'new-password'
See the manual for more instructions.

NOTE:  If you are upgrading from a MySQL <= 3.22.10 you should run
the ./bin/mysql_fix_privilege_tables. Otherwise you will not be
able to use the new GRANT command!

You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests

Please report any problems with the ./bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at https://order.mysql.com
[root@localhost mysql]# chown -R root .
[root@localhost mysql]# chown -R mysql data
[root@localhost mysql]# chgrp -R mysql .
[root@localhost mysql]# bin/mysqld_safe --user=mysql
Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/run/mysqld/mysqld.pid
060410 14:32:15  mysqld ended

[root@localhost mysql]# cd bin
[root@localhost bin]# ./mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

不知什么地方出错了,请高手们指教……
 楼主| 发表于 2006-4-10 16:29:52 | 显示全部楼层
已经试过提示的命令,比如说:
./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h localhost.localdomain password 'new-password'
服务器没启动,设置不了密码。

我想问题应该出在这里:
Starting mysqld daemon with databases from /var/lib/mysql
在/var/lib/mysql下能找到
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'这里所提到的'mysql.sock'

请问接下来要如何操作才能启动MySQL呢 ?
回复

使用道具 举报

 楼主| 发表于 2006-4-10 17:26:14 | 显示全部楼层
找到问题所在,查看了文章,做了如下步骤,还是无法启动:
[root@localhost bin]# chown -R mysql:mysql /var/lib/mysql
[root@localhost bin]# ./mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
[root@localhost bin]# cd /
[root@localhost /]# chown -R mysql:mysql /var/lib/mysql
[root@localhost /]# cd usr/local/mysql
[root@localhost mysql]# cd bin
[root@localhost bin]# ./mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
[root@localhost bin]# chown -R root /usr/local/mysql
[root@localhost bin]# chgrp -R mysql /usr/local/mysql
[root@localhost bin]# chown -R root /usr/local/mysql/bin
[root@localhost bin]# chgrp -R mysql /usr/local/mysql/bin
[root@localhost bin]# chgrp -R mysql /var/lib/mysql
[root@localhost bin]# chmod 777 /var/lib/mysql
[root@localhost bin]# chown -R root /var/lib/mysql/mysql
[root@localhost bin]# chgrp -R mysql /var/lib/mysql/mysql
[root@localhost bin]# chmod 777 /var/lib/mysql/mysql
[root@localhost bin]# chown -R root /var/lib/mysql/mysql/*
[root@localhost bin]# chgrp -R mysql /var/lib/mysql/mysql/*
[root@localhost bin]# chmod 777 /var/lib/mysql/mysql/*
[root@localhost bin]# chmod 777 /usr/local/mysql/lib/libmysqlclient.a
[root@localhost bin]# cd ..
[root@localhost mysql]# cd support-files
[root@localhost support-files]# cp mysql.server /etc/rc.d/init.d/mysqld
[root@localhost support-files]# chkconfig --add mysqld
[root@localhost support-files]# cd /
[root@localhost /]# cd /etc/rc.d/init.d/
[root@localhost init.d]# ./mysqld start
Starting MySQLCouldn't find MySQL manager or server        [失败]
[root@localhost init.d]# cd /
[root@localhost /]# ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql
[root@localhost /]# ln -s /usr/local/mysql/include/mysql /usr/include/mysql
[root@localhost /]# cd usr/local/mysql/bin
[root@localhost bin]# ./mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-2 18:23 , Processed in 0.054229 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

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