Starting MySQL.The server quit without updating PID file (datamysqllinux.pid).

问题现象:
启动mysql的时候报如下错误:
Starting MySQL.The server quit without updating PID file (datamysqllinux.pid).

分析过程:

查看启动日志:
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
130827 10:46:47  InnoDB: Waiting for the background threads to start
130827 10:46:48 InnoDB: 5.5.32 started; log sequence number 0
130827 10:46:48 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130827 10:46:48 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
130827 10:46:48 [Note] Server socket created on IP: '0.0.0.0'.
130827 10:46:48 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
130827 10:46:48 mysqld_safe mysqld from pid file /data/mysql/linux.pid ended


从日志可以看出系统表没有创建,但mysql_install_db这个脚本是运行过的;
运行时的界面如下:
linux:/usr/bin # perl  mysql_install_db
Installing all prepared tables
130827 10:51:13  /usr/sbin/mysqld: Shutdown Complete


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

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


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 /usr/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

但是执行过mysql_install_db后,数据目录下仍旧为空;系统表未创建成功;


问题原因和解决方法:
 mysql_install_db没加特定参数,系统表没有创建成功;
重新加参数执行mysql_install_db之后可以成功创建系统表,mysql启动成功;
mysql_install_db  --basedir=/usr/local/mysql --datadir=/data/mysql/

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值