zoukankan      html  css  js  c++  java
  • Mysql::Error: Commands out of sync; you can't run this command now: SHOW TABLES解决方案

    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,或许能解决问题。

  • 相关阅读:
    Doing Homework 简单dp&&状态压缩
    嫖裤子序列
    王宁宁宁
    友军寻路法
    Viviani
    ccf 201909-3
    ccf 201909-5
    链式前向星
    ccf-201909-04
    ccf -201909-2
  • 原文地址:https://www.cnblogs.com/yank/p/1515680.html
Copyright © 2011-2022 走看看