摘要:
Ruby使用DBI连接MySQL数据库一般为:require "dbi"dbh = DBI.connect("dbi:Mysql:test:localhost", "root", "123456")dbh.disconnect if dbh 但是当mysql数据库端口改变时,如果直接在“dbi:Mysql:test:localhost”后面加上端口号,如“dbi:Mysql:test:localhost:10086”,将出现错误代码为2003的异常:C:/Ruby193/lib/ruby/gems/1.9.1/ge 阅读全文