初始化MySQL服务后,使用/etc/init.d/mysqld启动MySQL服务,报错,查看其错误日志error.log:mysql
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端口已经被占用sql
缘由:初始化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 bash