Solved

Converting database from MyISAM to InnoDB

Posted on 2014-01-08
6
392 Views
Last Modified: 2014-01-14
Hello

I am about to convert a database from MyISAM to InnoDB and I was advised by someone that there might be 'structural issues' to resolve first. However that was all they said! Do you know what kind to structural issues could prevent a database from being converted from MyISAM to InnoDB. I am aware that InnDB doesn't support fulltext searches before 5.6 so fulltext fields could be a 'structural' issue in one sense, but I am presuming any schema can be converted from MyISAM to InnoDB.

Many thanks
0
Comment
Question by:andieje
  • 3
  • 2
6 Comments
 
LVL 59

Accepted Solution

by:
Kevin Cross earned 250 total points
ID: 39765704
See the following http://dev.mysql.com/doc/refman/5.6/en/storage-engines.html, specifically the "Storage Engine Features Summary" table.  You will notice the storage limit, which may not be of consequence with data below 64TB; however, I think it highlights the optimal usage of each engine.  INNODB is better for transactional consistency/reliability while MyISAM is good for data warehousing (i.e., long-term storage and read-only systems).  With respect to storage, MyISAM tables are in three files, but INNODB lumps entire table into one and even entire database.  Therefore, it is important to understand this with the physical size limitations.

You will have to see if the other differences affect you.  For example, do you use geo-spatial data types in indexing?  INNODB does not support this whereas MyISAM does.  Little things like this can creep up, so the recommendation probably is to familiarize yourself with the strengths and weaknesses of both; therefore, I included reference links to both engines below.

In addition, review the limitations of INNODB:
http://dev.mysql.com/doc/refman/5.6/en/innodb-restrictions.html

Respectfully yours,

Kevin

MyISAM: http://dev.mysql.com/doc/refman/5.6/en/myisam-storage-engine.html
INNODB: http://dev.mysql.com/doc/refman/5.6/en/innodb-default-se.html
0
 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 250 total points
ID: 39765938
If I thought I needed to move from MyISAM to InnoDB, I would create a new InnoDB table and copy the data over from the MyISAM table to the InnoDB table.
0
 
LVL 59

Expert Comment

by:Kevin Cross
ID: 39765978
I agree with Dave.  It also will allow you to resolve the "structural" issues as you are designing the new tables.
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

Author Comment

by:andieje
ID: 39766302
Hi - Thanks for your answer.

 Can I ask why you would create new tables rather than simply use an alter statement to change the databsae engine?

In terms of creating new tables, Can i clarify this is what you mean:

1. create a new table with innodb engine
2. export data only from existing table into file or whatever
3. Import this data into the new table

What commands are best to use to do this? Is this the right command to export the data and create insert statements

mysqldump --skip-triggers --compact --no-create-info
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39766328
Creating a new table that uses InnoDB and copying is so that you won't suffer any data loss if the conversion goes wrong.  I believe that you don't even have to export the data if the table is in the same database.  Read the info on this page:  http://dev.mysql.com/doc/refman/5.6/en/ansi-diff-select-into-table.html   It looks like you can do the whole operation in one line of SQL.  If you have created the new table, you case use:

INSERT INTO `table2` SELECT * FROM `table1`;
0
 
LVL 59

Expert Comment

by:Kevin Cross
ID: 39766331
Creating a new table protects you from conversion corrupting data.  It avoids dealing with issues of conversion in the original table by allowing you the opportunity to redesign your intended schema in the new engine.  Because the purposes and features of the engine are different, it could alter the design.  Therefore, it is like migrating from one database to another.  You can use tools to automate the migration, but often the headache of resolving the issues caused by the automation are worse than the tedious nature of recreating system from scratch and importing data if that makes sense.

EDIT: Just saw Dave's post.  Ditto.
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MySQL Error 3 43
Amazon Redshift 2 33
How many transactions can mysql handle? 3 31
change database name 2 28
As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
I use MySQL for many of my development projects in a Windows environment. To manage my databases (and perform queries) for years I used a tool called MySQL administrator.  This tool has since been replaced by MySQL Workbench. So I decided to m…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question