programming:php:mysql-table-converter
Конвертирование всех таблиц в InnoDB
mysql_connect('localhost', 'root', 'пароль'); $res = mysql_query('SHOW DATABASES'); while (list($dbname) = mysql_fetch_row($res)) { mysql_select_db($dbname); $rec = mysql_query('SHOW TABLE STATUS'); while ($data = mysql_fetch_object($rec)) if ($data->Engine == 'InnoDB') { echo 'Processing ', $dbname, '.', $data->Name, ' ... '; flush(); mysql_query("ALTER TABLE {$data->Name} ENGINE=InnoDB"); echo "done.n"; } mysql_free_result($rec); } mysql_free_result($res);
programming/php/mysql-table-converter.txt · Последнее изменение: 2017/03/27 11:26 — artur