MySQL's data database is only. frm and. MyD and. Myi No, use normal

Source: Internet
Author: User
Tags php script

database files in normal data directory as long as table structure file frm file ... I know what I'm doing after I dig.

MySQL's default database engine mode is set to InnoDB.

The InnoDB table has no myd and. MYI, and its data file corresponds to the ibdata1 file

To have the database files for. MyD and. Myi also appear, the conversion table type InnoDB is MyISAM.

Workaround:

Convert InnoDB type to MyISAM command in SQL

ALTER table name engine= MyISAM;

Go with the code.

ALTER table name Engine=myisam CHARACTER SET UTF8;

The following provides a database for bulk conversion of PHP code

A PHP script, no error checking, careful use, preferably before the use of backup!

, Save as Zhuanhuan.php

12345678910111213141516171819202122 <?php//Connect to database$host=' localhost '; $user=' Mysql_username '; //Manage account $passwd=' Mysql_password '; //password $db=' Wordpressdb '; //Database name $link= mysql_connect($host,$user,$passwd); if (! $link) { die(' Could not connect: '. Mysql_error() ); } mysql_select_db ( $ Db, $link or die ( ' can\ ' t use ' .< Span class= "crayon-h" > $db . mysql_error () Span class= "Crayon-sy", $result=mysql_query("Show Tables") or Die ( mysql_error ());while($row=mysql_fetch_row($result)){ #echo $row [0];#var_dump ($row);echo "$row [0] \ n"; mysql_query("ALTER TABLE $row [0] engine= ' MYISAM '") or Die (mysql_ Error()); }#var_dump ($result);mysql_close($link); ?>

Upload to Web site root directory .... Access to complete the batch conversion http://www.skyfox.org/zhuanhuan.php

-----------------------------------------------------------------

You can specify the engine when building the table, or you can specify the default engine
My.ini found under window in Linux my.cnf
Default-storage-engine, if there
No, join directly
Default-storage-engine=myisam
You can do it.

MySQL's data database is only. frm and. MyD and. Myi No, use normal

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.