码迷,mamicode.com
首页 > 数据库 > 详细

初始化MySQL后服务不能正常启动

时间:2015-04-21 09:58:54      阅读:257      评论:0      收藏:0      [点我收藏+]

标签:mysql初始化   mysql启动报错   

初始化MySQL服务后,使用/etc/init.d/mysqld启动MySQL服务,报错,查看其错误日志error.log:

150413 21:26:54 mysqld_safe mysqld from pid file /data/mysqldata/mysql.pid ended

150413 21:30:19 mysqld_safe Starting mysqld daemon with databases from /data/mysqldata

2015-04-13 21:30:21 27464 [Note] Plugin ‘FEDERATED‘ is disabled.

2015-04-13 21:30:21 27464 [Note] InnoDB: Using atomics to ref count buffer pool pages

2015-04-13 21:30:21 27464 [Note] InnoDB: The InnoDB memory heap is disabled

2015-04-13 21:30:21 27464 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2015-04-13 21:30:21 27464 [Note] InnoDB: Compressed tables use zlib 1.2.3

2015-04-13 21:30:21 27464 [Note] InnoDB: Using Linux native AIO

2015-04-13 21:30:21 27464 [Note] InnoDB: Using CPU crc32 instructions

2015-04-13 21:30:21 27464 [Note] InnoDB: Initializing buffer pool, size = 24.0G

2015-04-13 21:30:23 27464 [Note] InnoDB: Completed initialization of buffer pool

2015-04-13 21:30:24 27464 [Note] InnoDB: Highest supported file format is Barracuda.

2015-04-13 21:30:25 27464 [Note] InnoDB: 128 rollback segment(s) are active.

2015-04-13 21:30:25 27464 [Note] InnoDB: Waiting for purge to start

2015-04-13 21:30:25 27464 [Note] InnoDB: 5.6.19 started; log sequence number 1626134

2015-04-13 21:30:25 27464 [Note] Server hostname (bind-address): ‘*‘; port: 3306

2015-04-13 21:30:25 27464 [Note] IPv6 is available.

2015-04-13 21:30:25 27464 [Note]   - ‘::‘ resolves to ‘::‘;

2015-04-13 21:30:25 27464 [Note] Server socket created on IP: ‘::‘.

2015-04-13 21:30:25 27464 [ERROR] Can‘t start server: Bind on TCP/IP port: Address already in use

2015-04-13 21:30:25 27464 [ERROR] Do you already have another mysqld server running on port: 3306 ?

2015-04-13 21:30:25 27464 [ERROR] Aborting


通过其报错信息,我们可以明显的看到3306端口已经被占用

原因:初始化MySQL的使用没有停止MySQL服务

  1. netstat -nputl|grep 3306 结果发现已经有一个MySQL服务在启动

    150413 21:30:29 mysqld_safe mysqld from pid file /data/mysqldata/mysql.pid ended

  2. 通过/etc/init.d/mysqld stop将MySQL服务停止,如果不行,则使用kill -9 pid将其杀死

  3. 再次启动MySQL服务:/etc/init.d/mysqld start 

    [root@localhost ~]# /etc/init.d/mysqld start 

   Starting MySQL........ SUCCESS!


切记:初始化MySQL时,一定要先停止数据库服务

service mysqld stop 


本文出自 “nagios故障” 博客,请务必保留此出处http://5250070.blog.51cto.com/5240070/1636316

初始化MySQL后服务不能正常启动

标签:mysql初始化   mysql启动报错   

原文地址:http://5250070.blog.51cto.com/5240070/1636316

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!