初始化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服務
netstat -nputl|grep 3306 結果發現已經有一個MySQL服務在啓動
150413 21:30:29 mysqld_safe mysqld from pid file /data/mysqldata/mysql.pid ended
通過/etc/init.d/mysqld stop將MySQL服務停止,如果不行,則使用kill -9 pid將其殺死
再次啓動MySQL服務:/etc/init.d/mysqld start 
[root@localhost ~]# /etc/init.d/mysqld start 
   Starting MySQL........ SUCCESS!


切記:初始化MySQL時,一定要先停止數據庫服務

service mysqld stop 


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章