你的位置:

问答吧

-> MySQL
-> 问题详情
为什么mysql启动不了?
我今天卸载了系统自带的mysql,重新安装,过程如下:
# userdel mysql
# groupadd mysql
# useradd -g mysql mysql
# cd /usr/local
# tar zxvf mysql-standard-4.1.18-pc-linux-gnu-i686.tar.gz
# mv mysql-standard-4.1.18-pc-linux-gnu-i686 mysql
# cd 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.
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
# chown -R root  .
# chown -R mysql data
# chgrp -R mysql .
# bin/mysqld_safe --user=mysql &
[1] 2884
[root@localhost mysql]# Starting mysqld daemon with databases from /usr/local/mysql/data
我查了一下网上的资料说要CP一个文件,做法:
# cd support-files/
# cp my-medium.cnf /etc/
# mv my-medium.cnf my.cnf
# bin/mysqld_safe --user=mysql &
[2] 3003
[root@localhost mysql]# A mysqld process already exists
[2]+  Exit 1                  bin/mysqld_safe --user=mysql
[root@localhost mysql]# service mysqld start
Timeout error occurred trying to start MySQL Daemon.
启动 MySQL:                                               [失败]
# vi mysql_stop.sh
!/bin/sh
/usr/local/mysql/bin/mysqladmin -uroot -p123456 shutdown
:wq
# chmod 755 mysql_stop.sh
# cp mysql_stop.sh /usr/sbin
cp:是否覆盖“/usr/sbin/mysql_stop.sh”? y
./bin/mysqld_safe &
[2] 3989
[root@localhost mysql]# A mysqld process already exists
我哪里做错了?该怎么办啊?
作者: 紫藤
发布时间: 2006-04-21
http://bbs.mysql.cn/thread-821-1-1.html
看看文章里的第五步你做了吗。
作者: shahaier
发布时间: 2006-04-21
谢谢你!~我还奇怪呢。这里怎么没有让用./configure 呢。
作者: 紫藤
发布时间: 2006-04-21
#./configure --prefix=/usr/local/mysql --with-charset=gb2312
NOTE: This is a MySQL binary distribution. It's ready to run, you don't
need to configure it!
To help you a bit, I am now going to create the needed MySQL databases
and start the MySQL server for you.  If you run into any trouble, please
consult the MySQL manual, that you can find in the Docs directory.
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.
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
Starting the mysqld server.  You can test that it is up and running
with the command:
./bin/mysqladmin version
[root@localhost mysql]# Starting mysqld daemon with databases from /usr/local/mysql/data
STOPPING server from pid file /usr/local/mysql/data/localhost.localdomain.pid
060421 10:15:20  mysqld ended
[root@localhost mysql]# chown -R mysql /usr/local/mysql
[root@localhost mysql]# ./configure --prefix=/usr/local/mysql --with-charset=gb2312
NOTE: This is a MySQL binary distribution. It's ready to run, you don't
need to configure it!
To help you a bit, I am now going to create the needed MySQL databases
and start the MySQL server for you.  If you run into any trouble, please
consult the MySQL manual, that you can find in the Docs directory.
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
Starting the mysqld server.  You can test that it is up and running
with the command:
./bin/mysqladmin version
[root@localhost mysql]# Starting mysqld daemon with databases from /usr/local/mysql/data
STOPPING server from pid file /usr/local/mysql/data/localhost.localdomain.pid
060421 10:15:58  mysqld ended
这是怎么回事啊?
作者: 紫藤
发布时间: 2006-04-21
你这样好吧,把你所有安装的都清楚掉,按照那个教程一步步的重新来做下,现在感觉你的东西好乱,没有什么头绪。
执行./configure --prefix=/usr/local/mysql --with-charset=gb2312的时候,看看你是否进入了相应的目录,还有C编译器可不可以用。
作者: shahaier
发布时间: 2006-04-21
可以请问一下怎么样清除掉我以前编译的那些嘛?
我今天早上把系统自带的删除了 # rpm -e --nodeps mysql-5.0.18-2.1
那我现在安装的是 mysql-standard-4.1.18-pc-linux-gnu-i686.tar.gz
我昨天安装过一次了,没有成功,我把解压后的mysql目录,用rm -rf 删除掉了
然后进行的今天的安装,这样做对嘛?我该怎么样改 呢?请你告诉我可以嘛?
这个mysql的安装折磨我快一个月了,我真的不知道该怎么办了?谢谢
作者: 紫藤
发布时间: 2006-04-21
我系统自带的mysql有这些?
# rpm -qa |grep -i mysql
MySQL-python-1.2.0-3.2.2
mysql-bench-5.0.18-2.1
mysql-connector-odbc-3.51.12-1.2.1
libdbi-dbd-mysql-0.8.1a-1.2.1
php-mysql-5.1.2-5
mysql-devel-5.0.18-2.1
perl-DBD-MySQL-3.0002-2.2.2
qt-MySQL-3.3.5-13
mysql-5.0.18-2.1
mysql-server-5.0.18-2.1
mod_auth_mysql-3.0.0-3

作者: 紫藤