For one of the environment, there was a requirement to install mysql 5.6 server on CentOS Linux and after installation we had to change the default data directory to the new location.
Everything was fine but during mysql server startup it was taking lot of time. When we checked the log then we observed the below error.
18548 [ERROR] Can’t start server: Bind on TCP/IP port: Address already in use
18548 [ERROR] Do you already have another mysqld server running on port: 3306 ?
18548 [ERROR] Aborting
Below are the error logs:
[oradb@orahowdb mysql]$ tail -100f /var/log/mysqld.log
tail: cannot open ‘/var/log/mysqld.log’ for reading: Permission denied
tail: no files remaining
[oradb@orahowdb mysql]$ sudo tail -100f /var/log/mysqld.log
2018-05-23 20:18:10 17743 [Note] Shutting down plugin ‘INNODB_CMP_RESET’
2018-05-23 20:18:10 17743 [Note] Shutting down plugin ‘INNODB_CMP’
2018-05-23 20:18:10 17743 [Note] Shutting down plugin ‘INNODB_LOCK_WAITS’
2018-05-23 20:18:10 17743 [Note] Shutting down plugin ‘INNODB_LOCKS’
2018-05-23 20:18:10 17743 [Note] Shutting down plugin ‘INNODB_TRX’
2018-05-23 20:18:10 17743 [Note] Shutting down plugin ‘InnoDB’
2018-05-23 20:18:10 17743 [Note] InnoDB: FTS optimize thread exiting.
2018-05-23 20:18:10 17743 [Note] InnoDB: Starting shutdown…
2018-05-23 20:18:12 17743 [Note] InnoDB: Shutdown completed; log sequence number 1602387
2018-05-23 20:18:12 17743 [Note] Shutting down plugin ‘BLACKHOLE’
2018-05-23 20:18:12 17743 [Note] Shutting down plugin ‘ARCHIVE’
2018-05-23 20:18:12 17743 [Note] Shutting down plugin ‘MRG_MYISAM’
2018-05-23 20:18:12 17743 [Note] Shutting down plugin ‘MyISAM’
2018-05-23 20:18:12 17743 [Note] Shutting down plugin ‘MEMORY’
2018-05-23 20:18:12 17743 [Note] Shutting down plugin ‘CSV’
2018-05-23 20:18:12 17743 [Note] Shutting down plugin ‘sha256_password’
2018-05-23 20:18:12 17743 [Note] Shutting down plugin ‘mysql_old_password’
2018-05-23 20:18:12 17743 [Note] Shutting down plugin ‘mysql_native_password’
2018-05-23 20:18:12 17743 [Note] Shutting down plugin ‘binlog’
2018-05-23 20:18:12 17743 [Note] /usr/sbin/mysqld: Shutdown complete
180523 20:18:12 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
180523 20:21:33 mysqld_safe Logging to ‘/var/log/mysqld.log’.
180523 20:21:33 mysqld_safe Starting mysqld daemon with databases from /DBdata/mysql
2018-05-23 20:21:33 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use –explicit_defaults_for_timestamp server option (see documentation for more details).
2018-05-23 20:21:33 0 [Note] /usr/sbin/mysqld (mysqld 5.6.40) starting as process 18548 …
2018-05-23 20:21:33 18548 [Warning] Buffered warning: Changed limits: max_open_files: 1024 (requested 5000)
2018-05-23 20:21:33 18548 [Warning] Buffered warning: Changed limits: table_open_cache: 431 (requested 2000)
2018-05-23 20:21:33 18548 [Note] Plugin ‘FEDERATED’ is disabled.
2018-05-23 20:21:33 18548 [Note] InnoDB: Using atomics to ref count buffer pool pages
2018-05-23 20:21:33 18548 [Note] InnoDB: The InnoDB memory heap is disabled
2018-05-23 20:21:33 18548 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-05-23 20:21:33 18548 [Note] InnoDB: Memory barrier is not used
2018-05-23 20:21:33 18548 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-05-23 20:21:33 18548 [Note] InnoDB: Using Linux native AIO
2018-05-23 20:21:33 18548 [Note] InnoDB: Using CPU crc32 instructions
2018-05-23 20:21:33 18548 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2018-05-23 20:21:33 18548 [Note] InnoDB: Completed initialization of buffer pool
2018-05-23 20:21:33 18548 [Note] InnoDB: Highest supported file format is Barracuda.
2018-05-23 20:21:33 18548 [Note] InnoDB: 128 rollback segment(s) are active.
2018-05-23 20:21:33 18548 [Note] InnoDB: Waiting for purge to start
2018-05-23 20:21:33 18548 [Note] InnoDB: 5.6.40 started; log sequence number 1602387
2018-05-23 20:21:33 18548 [Note] Server hostname (bind-address): ‘*’; port: 3306
2018-05-23 20:21:33 18548 [Note] IPv6 is available.
2018-05-23 20:21:33 18548 [Note] – ‘::’ resolves to ‘::’;
2018-05-23 20:21:33 18548 [Note] Server socket created on IP: ‘::’.
2018-05-23 20:21:33 18548 [ERROR] Can’t start server: Bind on TCP/IP port: Address already in use
2018-05-23 20:21:33 18548 [ERROR] Do you already have another mysqld server running on port: 3306 ?
2018-05-23 20:21:33 18548 [ERROR] Aborting
Finally, we checked the mysql TCP/IP port[3306]:
[root@orahowdb ~]# lsof -i TCP:3306
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mysqld 17915 mysql 10u IPv6 55522 0t0 TCP *:mysql (LISTEN)