1

I have migrated my operating system from Windows to Centos 7 without getting backup of mysql through mysqldump. Now I have mysql data files .frm and .ibd . I want to migrate them

How can I migrate the database.

  • Please re-read the help→tour, especially the part about no distraction, no chit-chat. I already removed the superfluous parts from your post. Have a look at the edit history to see what you included that was inappropriate for this site. Appreciation is shown by voting on posts. – Anthon May 25 '15 at 6:02
0

This is very much possible. This process I am going to explain is valid for a Ubuntu based system, but I hope there wouldn't be much differences for CentOS.

Essentially, you will need to copy your mysql data files to the /var/lib/mysql/ folder. Mysql data files are distributes inside this folder as:

.
|-- debian-5.5.flag
|-- ibdata1
|-- ib_logfile0
|-- ib_logfile1
|-- drupal
|   |-- actions.frm
|   |-- actions.MYD
|   |-- actions.MYI
|   |-- wysiwyg.frm
|   |-- wysiwyg.MYD
|   |-- wysiwyg.MYI
|   |-- wysiwyg_user.frm
|   |-- wysiwyg_user.MYD
|   |-- wysiwyg_user.MYI
|   |-- xmlsitemap.frm
|   |-- xmlsitemap.MYD
|   |-- xmlsitemap.MYI
|   |-- xmlsitemap_sitemap.frm
|   |-- xmlsitemap_sitemap.MYD
|   `-- xmlsitemap_sitemap.MYI
|-- mysql
|   |-- columns_priv.frm
|   |-- columns_priv.MYD
|   |-- columns_priv.MYI
|   |-- db.frm
|   |-- db.MYD
|   |-- db.MYI
|   |-- event.frm
|   |-- event.MYD
|   |-- event.MYI
|   |-- func.frm
|   |-- func.MYD
|   |-- func.MYI
|   |-- general_log.CSM
|   |-- general_log.CSV
|   |-- general_log.frm
|   |-- help_category.frm
|   |-- help_category.MYD
|   |-- help_category.MYI
|   |-- help_keyword.frm
|   |-- help_keyword.MYD
|   |-- help_keyword.MYI
|   |-- procs_priv.MYI
|   |-- proxies_priv.frm
|   |-- proxies_priv.MYD
|   |-- proxies_priv.MYI
|   |-- servers.frm
|   |-- servers.MYD
|   |-- servers.MYI
|   |-- slow_log.CSM
|   |-- slow_log.CSV
|   |-- slow_log.frm
|   |-- tables_priv.frm
|   |-- tables_priv.MYD
|   |-- tables_priv.MYI
|   |-- time_zone.frm
|   |-- time_zone_leap_second.frm
|   |-- time_zone_leap_second.MYD
|   |-- time_zone_leap_second.MYI
|   |-- time_zone.MYD
|   |-- time_zone.MYI
|   |-- time_zone_name.frm
|   |-- time_zone_name.MYD
|   |-- time_zone_name.MYI
|   |-- time_zone_transition.frm
|   |-- time_zone_transition.MYD
|   |-- time_zone_transition.MYI
|   |-- time_zone_transition_type.frm
|   |-- time_zone_transition_type.MYD
|   |-- time_zone_transition_type.MYI
|   |-- user.frm
|   |-- user.MYD
|   `-- user.MYI
|-- mysql_upgrade_info
|-- performance_schema
|   |-- cond_instances.frm
|   |-- db.opt
|   |-- events_waits_current.frm
|   |-- events_waits_history.frm
|   |-- events_waits_history_long.frm
|   |-- events_waits_summary_by_instance.frm
|   |-- events_waits_summary_by_thread_by_event_name.frm
|   |-- events_waits_summary_global_by_event_name.frm
|   |-- file_instances.frm
|   |-- file_summary_by_event_name.frm
|   |-- file_summary_by_instance.frm
|   |-- mutex_instances.frm
|   |-- performance_timers.frm
|   |-- rwlock_instances.frm
|   |-- setup_consumers.frm
|   |-- setup_instruments.frm
|   |-- setup_timers.frm
|   `-- threads.frm
|-- phpmyadmin
|   |-- db.opt
|   |-- pma_bookmark.frm
|   |-- pma_bookmark.MYD
|   |-- pma_bookmark.MYI
|   |-- pma_column_info.frm
|   |-- pma_column_info.MYD
|   |-- pma_column_info.MYI
|   |-- pma_designer_coords.frm
|   |-- pma_designer_coords.MYD
|   |-- pma_designer_coords.MYI
|   |-- pma_history.frm
|   |-- pma_history.MYD
|   |-- pma_history.MYI
|   |-- pma_pdf_pages.frm
|   |-- pma_pdf_pages.MYD
|   |-- pma_pdf_pages.MYI
|   |-- pma_recent.frm
|   |-- pma_recent.MYD
|   |-- pma_recent.MYI
|   |-- pma_relation.frm
|   |-- pma_relation.MYD
|   |-- pma_relation.MYI
|   |-- pma_table_coords.frm
|   |-- pma_table_coords.MYD
|   |-- pma_table_coords.MYI
|   |-- pma_table_info.frm
|   |-- pma_table_info.MYD
|   |-- pma_table_info.MYI
|   |-- pma_table_uiprefs.frm
|   |-- pma_table_uiprefs.MYD
|   |-- pma_table_uiprefs.MYI
|   |-- pma_tracking.frm
|   |-- pma_tracking.MYD
|   |-- pma_tracking.MYI
|   |-- pma_userconfig.frm
|   |-- pma_userconfig.MYD
|   `-- pma_userconfig.MYI

So, as you can see from the above trimmed output of tree command, data files are distributed inside sub-folders pertaining to each database. Most probably, your mysql database in windows-7 also distributed data in this form, so you just neeed to copy everything inside this folder.

After doing this, there is another key step. You will need to change the owner and group of all these files and folder to mysql. This is an important key step which I missed during migration once, and I had bang to my head till I figured it out. To do this, issue the command inside the /var/lib/mysql folder after copying files:

chown -R  mysql:mysql *
0

Yes, you are right but I don't have .MYI and .MYD files. After placing the required files and changing permissions, it shows the tables in phpmyadmin but while tying to open the tab

Table doesn't exist

Is it possible to generate .MYI and .MYD files

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.