修改表的存储引擎报错,如何处理?
[root@ldap-mysql-svn-trac var]# mysql -uroot -pmysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.1.41-log Source distributionType 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> update tables set engine='InnoDB' where table_schema in('bak','dms','DBTEST','access','csf','test');
ERROR 1046 (3D000): No database selected
mysql> use information_schema;
Database changed
mysql> update tables set engine='InnoDB' where table_schema in('bak','dms','DBTEST','access','csf','test');
ERROR 1044 (42000): Access denied for user 'root'@'localhost' to database 'information_schema'
mysql> select user();
+----------------+
| user() |
+----------------+
| root@localhost |
+----------------+
1 row in set (0.00 sec)mysql>
现在需要将所有的表变更成Innodb,但是有几百张表,我不能一张一张alter table tb set engine=‘innodb’;那样效率太慢了,我想到一个办法
update tables set engine='InnoDB' where table_schema in('bak','dms','DBTEST','access','csf','test');
但是却报错了,如上。大家有啥好的办法能让所有的表快速的从myisam变成innodb吗?
[root@ldap-mysql-svn-trac var]# mysql -uroot -pmysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.1.41-log Source distributionType 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> update tables set engine='InnoDB' where table_schema in('bak','dms','DBTEST','access','csf','test');
ERROR 1046 (3D000): No database selected
mysql> use information_schema;
Database changed
mysql> update tables set engine='InnoDB' where table_schema in('bak','dms','DBTEST','access','csf','test');
ERROR 1044 (42000): Access denied for user 'root'@'localhost' to database 'information_schema'
mysql> select user();
+----------------+
| user() |
+----------------+
| root@localhost |
+----------------+
1 row in set (0.00 sec)mysql>
现在需要将所有的表变更成Innodb,但是有几百张表,我不能一张一张alter table tb set engine=‘innodb’;那样效率太慢了,我想到一个办法
update tables set engine='InnoDB' where table_schema in('bak','dms','DBTEST','access','csf','test');
但是却报错了,如上。大家有啥好的办法能让所有的表快速的从myisam变成innodb吗?
没有出问题,只是要把所有的myisam存储引擎改成innodb而已。