Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
mysql [2007/12/01 17:30] a done |
mysql [2008/09/03 18:54] a |
||
---|---|---|---|
Line 28: | Line 28: | ||
mysql --user=username --password=password --execute=" | mysql --user=username --password=password --execute=" | ||
mysql --user=username --password=password --default-character-set=utf8 dbname < dump.sql | mysql --user=username --password=password --default-character-set=utf8 dbname < dump.sql | ||
+ | |||
+ | |||
+ | |||
===== From MySQL 4.x (latin1) to MySQL 5.x (latin2) and UTF8 data :) ===== | ===== From MySQL 4.x (latin1) to MySQL 5.x (latin2) and UTF8 data :) ===== | ||
Line 49: | Line 52: | ||
# cat shema| mysql --default-character-set=utf8 | # cat shema| mysql --default-character-set=utf8 | ||
# cat data| mysql --default-character-set=latin2 | # cat data| mysql --default-character-set=latin2 | ||
+ | |||
+ | ===== InnoDB ===== | ||
+ | [mysqld] | ||
+ | default-storage-engine=innodb | ||
+ | innodb_file_per_table=1 | ||
+ | innodb_flush_log_at_trx_commit=0 | ||
+ | innodb_thread_concurrency=2 | ||
+ | |||
+ | |||
+ | ==== Convert MyISAM tables to InnoDB ==== | ||
+ | [[http:// | ||
+ | |||
+ | If you want to convert a MyISAM table to InnoDB, the process is fairly easy, but you can do something extra to speed things up. Before converting the table, adjust its order so that the primary key column is in order: | ||
+ | |||
+ | ALTER TABLE tablename ORDER BY ' | ||
+ | |||
+ | This will pre-arrange the table so that it can be converted quickly without a lot of re-arranging required in MySQL. Then, simply change the table engine: | ||
+ | |||
+ | ALTER TABLE tablename ENGINE = INNODB; | ||
+ | |||
+ | If your table is large, then it may take a while to convert it over. There will probably be a fair amount of CPU usage and disk I/O in the process. | ||
+ | |||
+ | These statements are also safe in replicated environments. When you issue this statement to the master, it will begin the conversion process. Once it is complete on the master, the statement will roll down to the slaves, and they will begin the conversion as well. Keep in mind, however, that this can greatly reduce the performance of your configuration in the process. |