Skip to content

Technology Forum

SEO, Speed Up website, Server Optimization, Linux, Open Source Softwares

  • Home
  • General
    • Web Server
    • Website Formatting
  • IT Companies
  • Optimization
    • PHP
  • Linux
  • Home
  • MySQL
  • Script to convert InnoDB tables to MyISAM
HTML
HTML: Link rel – Preload
General
Popular Sites run on which Platforms?
General
Extensible Markup Language (XML)
Plesk Panel
Parallels Plesk for Linux services logs and configuration files
Linux
Manage and Tweak Dedicated Linux Hosting Web Server
Plesk Panel
Plesk: Self-Signed SSL Certificate

Script to convert InnoDB tables to MyISAM

Posted on November 23, 2014November 23, 2014 By admin No Comments on Script to convert InnoDB tables to MyISAM
MySQL
#!/bin/bash
 
MYSQLCMD=mysql
 
for db in `echo show databases | $MYSQLCMD | grep -v Database`; do
        for table in `echo show tables | $MYSQLCMD $db | grep -v Tables_in_`; do
                TABLE_TYPE=`echo show create table $table | $MYSQLCMD $db | sed -e's/.*ENGINE=\([[:alnum:]\]\+\)[[:space:]].*/\1/'|grep -v 'Create Table'`
                if [ $TABLE_TYPE = "InnoDB" ] ; then
                        mysqldump $db $table > $db.$table.sql
                        echo "ALTER TABLE $table ENGINE = MyISAM" | $MYSQLCMD $db
                fi
        done
done

Post navigation

❮ Previous Post: E-Mail Testing
Next Post: Add Trailing Slash to URL (.htaccess) ❯

You may also like

MySQL
Calculate Query Cache

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Enter Captcha Here : *

Reload Image

View Posts

  • HTML: Link rel – Preload
  • HTML: Attributes of rel
  • Linux Commands
  • Security HTTP Headers
  • WCAG 2.0 checklist

Categories

  • Domain Name
  • General
    • Servers
    • Web Server
    • Website Formatting
  • IT Companies
  • Linux
  • MySQL
  • Optimization
    • PHP
  • Troubleshooting
  • Web Hosting Control Panel
    • Plesk Panel
  • Websites
    • CSS
    • HTML
    • Optimization
  • Windows
    • Windows 10

Recent Posts

  • HTML: Link rel – Preload
  • HTML: Attributes of rel
  • Linux Commands
  • Security HTTP Headers
  • WCAG 2.0 checklist

Copyright © 2023 Technology Forum.