This is a simple script for WordPress that converts all the tables from innodb to MyISAM. Some times this operation improves the speed of saving a page or post from admin panel.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
<?php // DEVELOPED BY SBZ // $host = 'localhost'; // $user = ''; // $password = ''; // $db = ''; require 'wp-config.php'; $host = DB_HOST; $user = DB_USER; $password = DB_PASSWORD; $db = DB_NAME; $link=mysqli_connect("$host", $user, $password) or die(mysqli_error($link)); mysqli_select_db($link,"$db") or die(mysqli_error($link)); $sql = "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '$db' AND ENGINE = 'InnoDB'"; $rs = mysqli_query($link,$sql); while($row = mysqli_fetch_array($rs)) { $tbl = $row[0]; echo $tbl.'<br>'; $sql = "ALTER TABLE `$tbl` ENGINE=MyISAM"; mysqli_query($link,$sql); } ?> |
You can try it when it is very slow to save changes in a WordPress page or post.