Showing posts with label Mysql. Show all posts
Showing posts with label Mysql. Show all posts

08 August 2014

How to check your Current MySQL Version

How to check Mysql Version:-

[root@arjun mysql]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.19-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)

Copyright (c) 2000, 2014, 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 VARIABLES LIKE "%version%";
+-------------------------+---------------------------------------------------------+
| Variable_name           | Value                                                   |
+-------------------------+---------------------------------------------------------+
| innodb_version          | 5.6.19                                                  |
| protocol_version        | 10                                                      |
| slave_type_conversions  |                                                         |
| version                 | 5.6.19-enterprise-commercial-advanced                   |
| version_comment         | MySQL Enterprise Server - Advanced Edition (Commercial) |
| version_compile_machine | x86_64                                                  |
| version_compile_os      | Linux                                                   |
+-------------------------+---------------------------------------------------------+
7 rows in set (0.10 sec)

mysql>

MySQL: Failed Registration of InnoDB as a Storage Engine

MySQL: Failed Registration of InnoDB as a Storage Engine

 Error:-

[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!
[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!
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
[ERROR] Unknown/unsupported storage engine: InnoDB
[ERROR] Aborting

Verify your my.cnf file:-

[root@arjun mysql]# cat /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=root
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

[root@arjun mysql]#

Solution :-

[root@arjun mysql]# ls
arjun.bangalore.bedford.local.err  ibdata1  ib_logfile0  ib_logfile1  kbace  mysql  RPM_UPGRADE_HISTORY  RPM_UPGRADE_MARKER-LAST  test
[root@arjun mysql]# mv ibdata1 ibdata1_old
[root@arjun mysql]# mv ib_logfile0 ib_logfile0_old
[root@arjun mysql]# mv ib_logfile1 ib_logfile1_old
[root@arjun mysql]# pwd
/var/lib/mysql

[root@arjun mysql]# service mysql start
Starting MySQL...                                          [  OK  ]

[root@arjun mysql]# ls
arjun.bangalore.bedford.local.err  auto.cnf  ibdata1_old  ib_logfile0_old  ib_logfile1_old  mysql       RPM_UPGRADE_HISTORY      test
arjun.bangalore.bedford.local.pid  ibdata1   ib_logfile0  ib_logfile1      kbace            mysql.sock  RPM_UPGRADE_MARKER-LAST
[root@arjun mysql]#