请选择 进入手机版 | 继续访问电脑版
查看: 473|回复: 2

今天发生起MYSQL数据库无法启动现以结局参考于下

57

主题

97

帖子

2万

积分

网站编辑

Rank: 8Rank: 8

积分
24539
iris 发表于 2015-8-14 09:13:05 | 显示全部楼层 |阅读模式
1 问题
[root@localhost mysql]# /etc/rc.d/init.d/mysql status
MySQL is not running, but lock file(/var/lock/subsys/mysql[FAILED]
[root@localhost mysql]#/etc/rc.d/init.d/mysql start
Starting MySQL...The server quit withoutupdating PID file(/usr/local/mysql/data/localhost.localdomain.pid).                             [FAILED]

2 原因
没有初始化权限表

3 解决办法
#cd /usr/local/mysql(进入mysql安装目录)
#chown -R mysql.mysql .
#su - mysql
$cd server
$scripts/mysql_install_db

4 本人解决过程
[root@localhost ~]# cd/usr/local/mysql
[root@localhost mysql]# chown -Rmysql.mysql .
[root@localhost mysql]# su - mysql
[mysql@localhost ~]$ cd /usr/local/mysql
[mysql@localhost mysql]$scripts/mysql_install_db
Installing MySQLsystem tables...
OK
Filling help tables...
OK
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'
Alternatively you can run:
./bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd ./mysql-test ; perl mysql-test-run.pl
Please report any problems with the ./bin/mysqlbug script!
[mysql@localhost mysql]$ /usr/local/mysql/bin/mysqld_safe --user=mysql&
[1] 11767
[mysql@localhost mysql]$ 120502 07:01:17 mysqld_safe Logging to'/usr/local/mysql/data/localhost.localdomain.err'.
120502 07:01:17 mysqld_safe Starting mysqld daemon with databasesfrom /usr/local/mysql/data
[mysql@localhost mysql]$ /etc/rc.d/init.d/mysql status
MySQL running(11830)                                     [  OK  ]
[mysql@localhost mysql]$ /etc/rc.d/init.d/mysql start
StartingMySQL                                            [  OK  ]

由为我之前改了数据库文件目录权限所以改完要对MYSQL初始化一次。
回复

使用道具 举报

8

主题

190

帖子

1579

积分

shopnc本科生

Rank: 6Rank: 6

积分
1579
woshiwy 发表于 2015-12-3 13:58:53 | 显示全部楼层
激动人心,无法言表!强烈支持51shopnc
回复 支持 反对

使用道具 举报

0

主题

113

帖子

242

积分

shopnc高中生

Rank: 3Rank: 3

积分
242
aihuione 发表于 2016-10-9 19:03:35 | 显示全部楼层
激动人心,无法言表!强烈支持51shopnc
回复 支持 反对

使用道具 举报

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

本版积分规则