The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Change database from myisam to innodb

Discussion in 'General Discussion' started by boyforeigner, Jan 3, 2008.

  1. boyforeigner

    boyforeigner Well-Known Member

    Joined:
    May 18, 2003
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    6
    How to change database from myisam to innodb, I just want the database, tables are already changed. (MySQL 5.0)
     
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    InnoDB is a Table type, not a Database type. If you already converted the tables, then you are done.
     
  3. skatebored

    skatebored Member

    Joined:
    Sep 3, 2007
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    innodb

    and exactly how we can do that convertion¿
     
  4. WiroWaas

    WiroWaas Member

    Joined:
    Aug 11, 2006
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Yes, how to do this? so then we can use InnoDB
     
  5. sabarishks

    sabarishks Active Member

    Joined:
    Jun 29, 2007
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Take a backup before proceeding.

    This script is used to convert the whole mysql database to innodb.

    #/bin/bash
    #script to convert the whole database to innodb format.
    cp -iRfp /var/lib/mysql /var/lib/mysql-$(date +%s)
    for mydatabase in $(mysql --batch --column-names=false -e "show databases");
    do
    for t in $(mysql --batch --column-names=false -e "show tables" $mydatabase);
    do
    mysql -e "alter table $t type=InnoDB" $mydbname;
    echo "converted "$t" to innodb"
    done
    done
     
Loading...

Share This Page