访问被拒绝MYSQL,但我刚刚创建了rails app并且database.yml文件看起来不错?

时间:2013-07-17 01:31:35

标签: mysql ruby-on-rails

我对此感到有点失落。我创建了rails app,安装了mysql包并检查了我的database.yml文件。一切似乎都有点,但我无法登录MYSQL。我试过mysql -u root。 mysql -u root -p。 mysqladmin -u也是。任何指针都将非常感激。

我的错误看起来像。

mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

的database.yml

  # 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
  encoding: utf8
  reconnect: false
  database: InterCambios_development
  pool: 5
  username: root
  password: 
  socket: /tmp/mysql.sock

# 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: InterCambios_test
  pool: 5
  username: root
  password: 
  socket: /tmp/mysql.sock

production:
  adapter: mysql2
  encoding: utf8
  reconnect: false
  database: InterCambios_production
  pool: 5
  username: root
  password: 
  socket: /tmp/mysql.sock

0 个答案:

没有答案