Enable InnoDB in MySQL - mysql

I want to use foreign key in MySQL. For that I needed to enable InnoDB feature. I have tried downloading latest version of MySQL Server from its official site.
I went through similar questions on stackoverflow but they addressed different issues.
I have tried editing all the .ini files and enabling InnoDB properties by removing # in front of corresponding properties.
Then I restarted MySQL and checked status of InnoDB from MySQL Client using query/
show engines;
It still shows InnoDB is disabled
I want to know steps of enabling the built in InnoDB feature for MySQL.
Here are the links to questions I visited:
Ques1
Ques2
Official MySQL forum
I am newbie in MySQL.
I will be very thankful for any help :-)

Check mysql log file. There could be some messages that may explain why InnoDB does not start. I suppose you don't have important InnoDB data. If so, try deleting ib_logfile0.xxx files and ibdata located in mysql data dir, then restart mysql to force those file to recreate. Also, check if innodb variables in my.cnf are properly configurated (For example, I have set memory for innodb_pool... to 1024G instead of 1024M, as a mistake).

Related

mysql 5.7.11 revert to myisam

I have installed wamp 3.0.6 and it install mysql 5.7.11.
But by default, I now end up with MyIsam tables.
In my.ini, I have default-storage-engine=MYISAM.
Why did it revert back to MyIsam?
The problem is that I'm teaching using WAMP and all my students have this problem. I know that I can simply change the my.ini file or change the var in phpmyadmin, but I wonder why it revert back?
thanks
It did not revert back, we intensionally set it back to default to MYISAM as many people were having many problems with corrupted INNODB databases.
A large proportion of WAMPServer users are first time users of all the technologies that make up WAMPServer.
Most never bother to do a database backup, until they get their first corruption.
Most dont bother to close WAMPServer down cleanly, and therefore INNODB can get corrupted more easily than MYISAM.
It was therefore deemed safer for the beginners to default to MYISAM and expect those that now what they are doing to amend the config, or specifically select INNODB in phpMyAdmin when they know that is the table type they want to use

Innodb Engine and Myisam Engine

I'm using mysql 5.5 version and using myisam engine for my database. But, Innodb engine not yet disabled. while I execute this command show variables like '%have%'; ,it returns have_innodb=yes. In this case,
can I disable the innodb engine and set zero to all innodb variables is possible ?
If you are using Windows, look for my.ini file in your MySQL Server installation directory. For Linux based OS look for my.cnf in the MySQL Server installation directory.
In that file un-comment the line skip-innodb by removing # from its beginning.
Note: Restart the server for watching changes taking effect.
EDIT:
When you have disabled Innodb, other Innodb related variables will not be set. You will not be able to access them.
See the screenshot attached first one when InnoDB is disabled, then InnoDB enabled
Hope it helps...

Changing the engine to InnoDB from MyISAM is not working

I am trying to change the table engine from MyISAM to INNODB. I am using the
alter table tablename ENGINE=INNODB
command. I am not getting any errors or warnings on the mysql side. I also commented the
skip-innodb
line in my.cnf file. So when I do a
show variables like 'have-innodb%'
it gives me a "YES". Also just to be on the safe side, I also deleted my ib_logfile0 and ib_logfile1 and restarted my mysql server.
But it still does not change the engine. I also did a show engines, and it shows innodb as one of the available engines.
Also these tables are full of data and have around 5000 rows, so is changing the engine type when a table has data, would that be the problem??
What could the missing link be??
Are you able to restart the server? If so, the error log will tell you if it had problems initialising the InnoDB engine.
Is this the first InnoDB table in your db? If so, you may have forgotten to create your ibdata files.
Does the table use fulltext indexing or other InnoDB-incompatible features?

Convert InnoDB to MyISAM with InnoDB disabled

I'm the lucker owner of a webhotel where the host changes settings without telling.
When thats said,
I have some tables in my database that are running with InnoDB engine.
But over the night the host have disabled InnoDB, so I cant convert it to MyISAM with ALTER command.
Anyway I can get the data out of the database, or convert it to MyISAM when InnoDB is disabled?
Only thing I see all the time is,
#1033 - Incorrect information in file: 'file.frm'
Thanks.
Unfortunately, you need to have InnoDB enabled so that MySQL could read the data for conversion.
To recover the data on another instance, you would need ibdata* files from MySQL root data directory as well as all *.ibd files from your database directory (if your MySQL setup had innodb_file_per_table enabled).

Missing InnoDb Engine

I just went to look over one my site's databases and noticed that all of the tables had been converted to MyISAM (they used to be InnoDB).
What's more is that InnoDB seems to missing, along with BerkeleyDB, Federated, and others.
A few months ago I upgraded from MySql 5.0 to 5.1.38. I can't imagine that I wouldn't have noticed if InnoDB was not installed after the upgrade, but maybe it's been that way since the upgrade. Having several 10 GB tables automatically convert themselves to MyISAM without hearing about any downtime seems very unlikely to me.
Regardless, the mysql system variable have_innodb is set to NO. Can I simply change that to YES or does that mean InnoDB is missing from the install?
Maybe InnoDB parameters were changed during upgrade? This advice from MySQL Forums helped me in a similar situation: http://forums.mysql.com/read.php?22,397052,408970
In short: Stop the MySQL daemon, delete ib_logfile* from datadir, restart MySQL.
If the field in SHOW ENGINES is "no" it means it's not compiled in. You would have to either compile the server again, compile the innodb plugin and load it or fetch server binaries which have it enabled.
You can't simply set the mysql system variable to YES to convert the table from MyISAM to InnoDB.
ALTER TABLE t1 ENGINE=InnoDB;
When InnoDB support is turned off even is you use ENGINE=InnoDB in your create table statements, the table will use the default storage engine for MySQL which is normally MyISAM.
It could also be the case that the innodb logfile[01] are corrupted. In which case the engine will show as disabled and the tables as ISAM. The log will mention it.