본문 바로가기
Develop/DB

[MySQL]MySQL업그레이드 후 오류

by bellsilver7 2016. 9. 6.
728x90

Mysql 5.1버전에서 Mysql 5.6버전으로 업그레이드 후 버전 확인을 했다.


[root@localhost ~]# mysql --version

mysql  Ver 14.14 Distrib 5.6.32, for Linux (x86_64) using  EditLine wrapper


기분좋게 성취감을 얻고 다음과 같이 Mysql을 시작하기 위해 명령어를 쳤다.

[root@localhost /]# service mysqld start

MySQL Daemon failed to start.

mysqld (을)를 시작 중:  [실패]


그런데 실패라니..


에러를 잡기 위해 다양한 시도를 했다.


[시도01]

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

MySQL Daemon failed to start.

mysqld (을)를 시작 중:  [실패]


[시도02]

[root@localhost /]# /usr/bin/mysqld_safe --user=root &

[1] 36961

[root@localhost /]# 160906 10:34:31 mysqld_safe Logging to '/var/log/mysqld.log'.

160906 10:34:31 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

160906 10:34:31 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended


[시도03]

[root@localhost /]# restorecon -R /var/lib/mysql/

[root@localhost /]# chcon -R --type=mysql_db_t /var/lib/mysql

[root@localhost /]# chcon -R --type=mysql_db_t /var/lib/mysql

이 방법을 했을 땐 다 이렇게 나왔다.

chcon: can't apply partial context to unlabeled file ...


[시도04]

[root@localhost /]# find -name mysql_install_db 

./usr/bin/mysql_install_db

[root@localhost /]# /usr/bin/mysql_install_db 

Installing MySQL system tables...2016-09-06 10:33:49 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2016-09-06 10:33:49 0 [Note] /usr/sbin/mysqld (mysqld 5.6.32) starting as process 36949 ...

2016-09-06 10:33:49 36949 [Note] InnoDB: Using atomics to ref count buffer pool pages

2016-09-06 10:33:49 36949 [Note] InnoDB: The InnoDB memory heap is disabled

2016-09-06 10:33:49 36949 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2016-09-06 10:33:49 36949 [Note] InnoDB: Memory barrier is not used

2016-09-06 10:33:49 36949 [Note] InnoDB: Compressed tables use zlib 1.2.3

2016-09-06 10:33:49 36949 [Note] InnoDB: Using Linux native AIO

2016-09-06 10:33:49 36949 [Note] InnoDB: Using CPU crc32 instructions

2016-09-06 10:33:49 36949 [Note] InnoDB: Initializing buffer pool, size = 128.0M

2016-09-06 10:33:49 36949 [Note] InnoDB: Completed initialization of buffer pool

2016-09-06 10:33:49 36949 [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!

2016-09-06 10:33:49 36949 [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 new 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!

2016-09-06 10:33:49 36949 [ERROR] Plugin 'InnoDB' init function returned error.

2016-09-06 10:33:49 36949 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

2016-09-06 10:33:49 36949 [ERROR] Unknown/unsupported storage engine: InnoDB

2016-09-06 10:33:49 36949 [ERROR] Aborting


2016-09-06 10:33:49 36949 [Note] Binlog end

2016-09-06 10:33:49 36949 [Note] /usr/sbin/mysqld: Shutdown complete



위처럼 저 방법을 돌려가며 계속 명령을 내려봤지만 에러에는 변함이 없었다.


결국 해결법은 에러로그를 확인하는 것이었다.


[root@localhost /]# vi /var/log/mysqld.log

160906 09:58:44 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

2016-09-06 09:58:44 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2016-09-06 09:58:44 0 [Note] /usr/sbin/mysqld (mysqld 5.6.32) starting as process 32747 ...

2016-09-06 09:58:44 32747 [Note] Plugin 'FEDERATED' is disabled.

2016-09-06 09:58:44 32747 [Note] InnoDB: Using atomics to ref count buffer pool pages

2016-09-06 09:58:44 32747 [Note] InnoDB: The InnoDB memory heap is disabled

2016-09-06 09:58:44 32747 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2016-09-06 09:58:44 32747 [Note] InnoDB: Memory barrier is not used

2016-09-06 09:58:44 32747 [Note] InnoDB: Compressed tables use zlib 1.2.3

2016-09-06 09:58:44 32747 [Note] InnoDB: Using Linux native AIO

2016-09-06 09:58:44 32747 [Note] InnoDB: Using CPU crc32 instructions

2016-09-06 09:58:44 32747 [Note] InnoDB: Initializing buffer pool, size = 128.0M

2016-09-06 09:58:44 32747 [Note] InnoDB: Completed initialization of buffer pool

2016-09-06 09:58:44 32747 [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!

2016-09-06 09:58:44 32747 [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 new 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!

2016-09-06 09:58:44 32747 [ERROR] Plugin 'InnoDB' init function returned error.

2016-09-06 09:58:44 32747 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

2016-09-06 09:58:44 32747 [ERROR] Unknown/unsupported storage engine: InnoDB

2016-09-06 09:58:44 32747 [ERROR] Aborting


2016-09-06 09:58:44 32747 [Note] Binlog end

2016-09-06 09:58:44 32747 [Note] Shutting down plugin 'partition'

2016-09-06 09:58:44 32747 [Note] Shutting down plugin 'BLACKHOLE'

2016-09-06 09:58:44 32747 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'

2016-09-06 09:58:44 32747 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'

2016-09-06 09:58:44 32747 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'

2016-09-06 09:58:44 32747 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'

2016-09-06 09:58:44 32747 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'

2016-09-06 09:58:44 32747 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'

2016-09-06 09:58:44 32747 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'

2016-09-06 09:58:44 32747 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'

2016-09-06 09:58:44 32747 [Note] Shutting down plugin 'INNODB_SYS_TABLES'

2016-09-06 09:58:44 32747 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'

2016-09-06 09:58:44 32747 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'

2016-09-06 09:58:44 32747 [Note] Shutting down plugin 'INNODB_FT_CONFIG'

2016-09-06 09:58:44 32747 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'

2016-09-06 09:58:44 32747 [Note] Shutting down plugin 'INNODB_FT_DELETED'

2016-09-06 09:58:44 32747 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'



로그는 위와 같았고 warning은 과감히 넘기고 제일 처음 에러를 검색했다.

2016-09-06 09:58:44 32747 [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!


아래 사이트를 통해 해결법을 얻었다.

http://sharadchhetri.com/2014/11/29/upgrading-mysql-5-1-5-6-service-failed-start/


/etc/my.cnf 의 [mysqld]블럭 안에 

innodb_data_file_path = ibdata1:10M:autoextend

를 넣어주는 것으로 mysql을 시작할 수 있게 됬다.



728x90

댓글