magento修复数据表存储引擎为InnoDB

来源:互联网 发布:软件项目的软件schdule 编辑:程序博客网 时间:2024/05/18 00:24
header('Content-Type:text/html;charset-UTF-8');require_once 'app/Mage.php';Mage::app('default');$read = Mage::getSingleton('core/resource')->getConnection('core_read');$write = Mage::getSingleton('core/resource')->getConnection('core_write');$nochange = array('cataloginventory_stock_status_tmp','catalog_category_anc_categs_index_tmp','catalog_category_anc_products_index_tmp','catalog_category_product_index_enbl_tmp','catalog_category_product_index_tmp','catalog_product_index_eav_decimal_tmp','catalog_product_index_eav_tmp','catalog_product_index_price_bundle_opt_tmp','catalog_product_index_price_bundle_sel_tmp','catalog_product_index_price_bundle_tmp','catalog_product_index_price_cfg_opt_agr_tmp','catalog_product_index_price_cfg_opt_tmp','catalog_product_index_price_downlod_tmp','catalog_product_index_price_final_tmp','catalog_product_index_price_opt_agr_tmp','catalog_product_index_price_opt_tmp','catalog_product_index_price_tmp','catalogsearch_fulltext','importexport_importdata','sendfriend_log');$sql = "SHOW TABLES FROM `tablename`";$rows = $read->fetchAll($sql);foreach($rows as $row){if(!in_array($row['Tables_in_tablename'],$nochange)){echo "ALTER TABLE `" . $row['Tables_in_voguerue'] . "` ENGINE = INNODB" . "<br />";$write->query("ALTER TABLE `" . $row['Tables_in_voguerue'] . "` ENGINE = INNODB");}}

0 0
原创粉丝点击