我很难连接到我在本地Windows 7机器上运行的mysql服务 - 我在尝试通过网络浏览器进行迁移或访问时遇到以下错误 -
Mysql2::Error (Can't connect to MySQL server on 'localhost' (10061)):
我将mysql user / pass作为默认设置 - 这是我的yaml conf文件
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MYSQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
# gem 'mysql2'
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
port: 3306
encoding: utf8
reconnect: false
database: events_development
pool: 5
username: root
password:
host: localhost
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: mysql2
encoding: utf8
reconnect: false
database: events_test
pool: 5
username: root
password:
host: localhost
production:
adapter: mysql2
encoding: utf8
reconnect: false
database: events_production
pool: 5
username: root
password:
host: localhost
问题是我可以在命令行上使用root登录mysql并通过xampp运行phpmyadmin-所以我已将其缩小到防火墙问题?或权限问题?一切都在我的机器上运行localhost
更新
我关闭了Windows防火墙,没有任何区别
答案 0 :(得分:0)
确保您已授予localhost权限。 Info here
答案 1 :(得分:0)
我重新启动机器并重新启动服务器 - 似乎正常工作
答案 2 :(得分:-1)
您是否在dev env中启动了服务器?