Mysql::Error: Commands out of sync; you can't run this command now: SHOW TABLES解决方案
2009-07-02 17:22
861 查看
ROR在迁移数据库时,出现如下错误:
rake aborted!Mysql::Error: Commands out of sync; you can't run this command now: SHOW TABLES
跟踪错误:
在mysql_adapter.rb里面找到SHOW TABLES
def tables(name = nil) #:nodoc:
tables = []
execute("SHOW TABLES", name).each { |field| tables << field[0] }
tables
end
在你将数据库执行清除为0版本时,又会出现 each的错误,非常麻烦。
--------------------------------------------
gem list --local
得到:mysql 2.7.3
安装的的mysql客户端为5.1
C:\Program Files\MySQL\MySQL Server 5.1\bin
mysql Ver 14.14 Distrib 5.1.30b, for Win32 (ia32)
--------------------------------------------
解决方案:
最简单的办法:直接重新安装5.0版本的mysql,一切恢复正常。
如果不能卸载现有的mysql,你可以找一个低版本的mysql,寻得其mysql/bin/目录下的扩展文件libmySQL,然后将其copy到ruby/bin,或许能解决问题。
rake aborted!Mysql::Error: Commands out of sync; you can't run this command now: SHOW TABLES
跟踪错误:
在mysql_adapter.rb里面找到SHOW TABLES
def tables(name = nil) #:nodoc:
tables = []
execute("SHOW TABLES", name).each { |field| tables << field[0] }
tables
end
在你将数据库执行清除为0版本时,又会出现 each的错误,非常麻烦。
--------------------------------------------
gem list --local
得到:mysql 2.7.3
安装的的mysql客户端为5.1
C:\Program Files\MySQL\MySQL Server 5.1\bin
mysql Ver 14.14 Distrib 5.1.30b, for Win32 (ia32)
--------------------------------------------
解决方案:
最简单的办法:直接重新安装5.0版本的mysql,一切恢复正常。
如果不能卸载现有的mysql,你可以找一个低版本的mysql,寻得其mysql/bin/目录下的扩展文件libmySQL,然后将其copy到ruby/bin,或许能解决问题。
相关文章推荐
- PHP执行MYSQL存储过程报错:Commands out of sync; you can't run this command now 问题的解决
- 解决error:2014 Commands out of sync; you can't run this command now
- MySQL一次执行多条语句的实现及常见问题(C API Commands out of sync; you can't run this command now)
- ERROR (ProgrammingError) (2014, "Commands out of sync; you can't run this command now")
- python mysql 2014 Commands out of sync; you can't run this command now
- 解决error:2014 Commands out of sync; you can't run this command now
- PHP执行MYSQL存储过程报错:Commands out of sync; you can't run this command now
- error:2014 Commands out of sync; you can't run this command now
- mysql 出现 Commands out of sync; you can't run this command now
- php用mysql_query()调用存储过程后无法再执行sql报错:commands out of sync you can't run this command now
- C++ Mysql调用 错误:2014 :Commands out of sync; you can't run this command now
- PHP执行MYSQL存储过程报错:Commands out of sync; you can't run this command now
- mysql: Commands out of sync; you can't run this command now
- PHP+MySQL连续插入数据报错:Commands out of sync; you can't run this command now & 读取Excel数据并批量插入到数据中
- 解决error:2014 Commands out of sync; you can't run this command now
- MySQL一次执行多条语句的实现及常见问题(C API Commands out of sync; you can't run this command now)
- Commands out of sync; you can't run this command now
- 解决mysql error:2014 Commands out of sync; you can't run this command now
- LR错误: Commands out of sync; you can't run this command now 解决方法
- Commands out of sync; you can't run this command now