Saturday, July 1, 2017

.::: Troubleshoot MySQL is not running, but lock file (/var/lock/subsys/mysql[FAILED] :::.

1. Problem MySQL cannot start & tried restart
[root@TeguhLab ~]# service mysql status
MySQL is not running, but lock file (/var/lock/subsys/mysql[FAILED]
[root@TeguhLab ~]# service mysql restart
MySQL server PID file could not be found!                  [FAILED]
Starting MySQL.The server quit without updating PID file (/[FAILED]mysql/TeguhLab.pid).
[root@TeguhLab ~]#

result "MySQL is not running, but lock file (/var/lock/subsys/mysql[FAILED]"

2. Cek log MySQL on MyDonain.err

[root@TeguhLab ~]# cd /var/lib/mysql
[root@TeguhLab mysql]# ls
cacti  ibdata1  ib_logfile0  ib_logfile1  mysql  RPM_UPGRADE_HISTORY  RPM_UPGRADE_MARKER-LAST  TeguhLab.err  test
[root@TeguhLab mysql]# cat /var/lib/mysql/TeguhLab.err

170809 15:30:31 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2017-08-09 15:30:31 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp
server option (see documentation for more details).
2017-08-09 15:30:31 0 [Note] /usr/sbin/mysqld (mysqld 5.6.34) starting as process 5289 ...
2017-08-09 15:30:31 5289 [Note] Plugin 'FEDERATED' is disabled.
2017-08-09 15:30:31 5289 [Note] InnoDB: Using atomics to ref count buffer pool pages
2017-08-09 15:30:31 5289 [Note] InnoDB: The InnoDB memory heap is disabled
2017-08-09 15:30:31 5289 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-08-09 15:30:31 5289 [Note] InnoDB: Memory barrier is not used
2017-08-09 15:30:31 5289 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-08-09 15:30:31 5289 [Note] InnoDB: Using Linux native AIO
2017-08-09 15:30:31 5289 [Note] InnoDB: Using CPU crc32 instructions
2017-08-09 15:30:31 5289 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2017-08-09 15:30:31 5289 [Note] InnoDB: Completed initialization of buffer pool
2017-08-09 15:30:31 5289 [ERROR] InnoDB: auto-extending data file ./ibdata1 is of a different size 640 pages (rounded down to MB)
than specified in the .cnf file: initial 768 pages, max 0 (relevant if non-zero) pages!
2017-08-09 15:30:31 5289 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the
 system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the ne
w ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any
 way. But be careful: do not remove old data files which contain your precious data!
2017-08-09 15:30:31 5289 [ERROR] Plugin 'InnoDB' init function returned error.
2017-08-09 15:30:31 5289 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2017-08-09 15:30:31 5289 [ERROR] Unknown/unsupported storage engine: InnoDB
2017-08-09 15:30:31 5289 [ERROR] Aborting

2017-08-09 15:30:31 5289 [Note] Binlog end
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'partition'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'ARCHIVE'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'INNODB_METRICS'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'INNODB_CMPMEM'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'INNODB_CMP'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'INNODB_LOCKS'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'INNODB_TRX'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'BLACKHOLE'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'MEMORY'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'MRG_MYISAM'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'CSV'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'MyISAM'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'sha256_password'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'mysql_old_password'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'mysql_native_password'
2017-08-09 15:30:31 5289 [Note] Shutting down plugin 'binlog'
2017-08-09 15:30:31 5289 [Note] /usr/sbin/mysqld: Shutdown complete

170809 15:30:31 mysqld_safe mysqld from pid file /var/lib/mysql/TeguhLab.pid ended


3. Focuse on problem
2017-08-09 15:30:31 5289 [ERROR] InnoDB: auto-extending data file ./ibdata1 is of a different size 640 pages (rounded down to MB)
than specified in the .cnf file: initial 768 pages, max 0 (relevant if non-zero) pages!
2017-08-09 15:30:31 5289 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the
 system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the ne
w ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any
 way. But be careful: do not remove old data files which contain your precious data!

4. Delete all ib_logfile's & Delete the ibdata1 file
[root@TeguhLab ~]# cd /var/lib/mysql
[root@TeguhLab mysql]# ls
cacti  ibdata1  ib_logfile0  ib_logfile1  mysql  RPM_UPGRADE_HISTORY  RPM_UPGRADE_MARKER-LAST  TeguhLab.err  test
[root@TeguhLab mysql]# rm -rf ibdata1 ib_logfile*
[root@TeguhLab mysql]# ls
cacti  mysql  RPM_UPGRADE_HISTORY  RPM_UPGRADE_MARKER-LAST  TeguhLab.err  test
[root@TeguhLab mysql]#

5. Restart MySQL Status
[root@TeguhLab mysql]# service mysql restart
MySQL server PID file could not be found!                  [FAILED]
Starting MySQL....                                         [  OK  ]
[root@TeguhLab mysql]#

6. Login to MySQL
[root@TeguhLab mysql]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.34 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| cacti              |
| mysql              |
| test               |
+--------------------+
4 rows in set (0.21 sec)

mysql> connect cacti;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Connection id:    2
Current database: cacti

mysql> show tables;
+---------------------------+
| Tables_in_cacti           |
+---------------------------+
| cdef                      |
| cdef_items                |
| colors                    |
| data_input                |
| data_input_data           |
| data_input_fields         |
| data_local                |
| data_template             |
| data_template_data        |
| data_template_data_rra    |
| data_template_rrd         |
| graph_local               |
| graph_template_input      |
| graph_template_input_defs |
| graph_templates           |
| graph_templates_gprint    |
| graph_templates_graph     |
| graph_templates_item      |
| graph_tree                |
| graph_tree_items          |
| host                      |
| host_graph                |
| host_snmp_cache           |
| host_snmp_query           |
| host_template             |
| host_template_graph       |
| host_template_snmp_query  |
| manage_admin_link         |
| manage_alerts             |
| manage_groups             |
| manage_host               |
| manage_poller_output      |
| manage_process            |
| manage_services           |
| manage_sites              |
| manage_tcp                |
| manage_templates          |
| manage_uptime_method      |
| plugin_config             |
| plugin_db_changes         |
| plugin_docs               |
| plugin_hooks              |
| plugin_realms             |
| poller                    |
| poller_command            |
| poller_item               |
| poller_output             |
| poller_reindex            |
| poller_time               |
| rra                       |
| rra_cf                    |
| settings                  |
| settings_graphs           |
| settings_tree             |
| snmp_query                |
| snmp_query_graph          |
| snmp_query_graph_rrd      |
| snmp_query_graph_rrd_sv   |
| snmp_query_graph_sv       |
| user_auth                 |
| user_auth_perms           |
| user_auth_realm           |
| user_log                  |
| version                   |
| weathermap_auth           |
| weathermap_data           |
| weathermap_groups         |
| weathermap_maps           |
| weathermap_settings       |
+---------------------------+
69 rows in set (0.00 sec)

mysql> exit
Bye
[root@TeguhLab mysql]#

No comments:

Post a Comment

Popular Posts