Convert the suffix. frm,. myd, and myi into. SQL and import it to the mysql database. frmmyi

Source: Internet
Author: User
Tags name database

Convert the suffix. frm,. myd, and myi into. SQL and import it to the mysql database. frmmyi

Use a local MySQL database to convert these files to. SQL scripts.

1. Install MySQL. The version and font must be the same as that on the server. Otherwise, garbled characters are displayed.
2. Use the create database name command to CREATE a DATABASE

MySQL data has the NAME folder.
3. copy the *. frm, *. myd, *. myi files to the data folder.

4. Run cmd to enter the bin directory of MySQL and use the command to export the. SQL script.

Mysqldump-u username-p password NAME> D:/NAME. SQL

Export NAME database to disk D and generate NAME. SQL script

5. Use Navicat to import. SQL


Database is frm, myd, myi backup how to import mysql

I found a case today and thought about it for a long time before analyzing it. The database is. frm,. myd, and myi backup. I won't import mysql. I found some information online and the import was successful. Set *. frm ,*. myd ,*. myi: The method for importing files to data 1. The simplest is to directly copy the files to the database folder under the data of the database, provided that the mysql version is consistent and the font is consistent. This method is simple and quick, but not anyone can do it. 2. Install mysql database conversion on the local machine *. frm ,*. myd ,*. myi, the file is *. SQL file: 1. First install mysql. The best version is the same as that on the server, and the font should be the same (after the inconsistency is imported, there will be a problem-garbled code ). 2. Run the database creation command to create a new database: create database name; (create a database named name) then go to the data folder under the mysql directory you installed and there will be a name folder, when I created the database named dbname, the system created a folder named after the database name. This folder is located in the data folder under the MySQL installation directory. I haven't found it for a long time, even in the MySQL installation directory, there is no data folder at all. google again. It turns out that there is a MySQL installation path under my. ini, open datadir in notepad, and there is a path behind it. My path is C:/ProgramData/MySQL Server5.1/Data/) 3. Set your *. frm ,*. myd ,*. all myi files are taken to the data folder. 4. Go to the bin directory of the mysql installation directory at the command prompt and export it as a *. SQL file. Mysqldump-uroot-p name. SQL. (Run. Note: name is the name of the database I created earlier. After that, you will find a name. SQL statement in the bin directory. How can this problem be solved. But when I was using it, I found that using the cd command at the command prompt could no longer enter the bin directory, or even could not change the current directory. Why? Is it because MySQL is installed? Double-click "mysqldump.exe" and the cmd window will flash away. The command cannot be entered. If you want to do this, you have to think about it. You can use batch processing to save time. Create a txt file in the bin directory, copy the above command, save it as, save all the files of the Save type, and take the above file name casually, but add the extension. bat, for example, "Create a text file. bat ", save. Double-click the generated bat file. (Some people will not use the cd command, So google will know it. For example, if I enter cde: \ aaa and the current directory is e: \ aaa after execution) some of my own operations: 1. It is best to save a lot of trouble in the command prompt in the root directory of the mysql database. 2. *. It is recommended that the exported file name of a table be dataname_tabname. SQL when SQL is inverted, so it is easy to remember and import. In addition, the exported *. SQL file for a table is small. Because many databases have limited size. For example, the DH space I use is limited to 10 MB. If it is too large, the data cannot be imported. (For exported data that exceeds the server limit, it can be compressed into a zip file or imported)

How can I convert the mysql database backup file myi myd frm into an SQL file to import the mysql database file?

Copy the file directly to the mysql data directory.
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.