拒绝用户“root@localhost”的Ruby on Rails MYSQL错误访问

时间:2022-02-09 21:35:33

I get the following error when starting rails server with a new app:

使用新应用程序启动rails服务器时,会出现以下错误:

/Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.6/lib/mysql2/client.rb:37:in `connect': Access denied for user 'root'@'localhost' (using password: YES) (Mysql2::Error)

/用户/弗雷德/ .rvm /珠宝/ ruby-1.9.2-p180 /珠宝/ mysql2-0.2.6 / lib / mysql2 /客户端。rb:37:在“connect”中:用户“root”@“localhost”的访问被拒绝(使用密码:YES) (Mysql2::Error)

Here is my database.yml

这是我的形式

# MySQL.  Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
#   gem install 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: group_chat_development
  pool: 5
  username: root
  password: admin
  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: group_chat_test
  pool: 5
  username: root
  password: admin
  socket: /tmp/mysql.sock

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

Below is the full error message

下面是完整的错误消息

MacPro:FireDemon fred$ rails s
=> Booting Mongrel
=> Rails 3.0.3 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.6/lib/mysql2/client.rb:37:in `connect': Access denied for user 'root'@'localhost' (using password: YES) (Mysql2::Error)
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.6/lib/mysql2/client.rb:37:in `initialize'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.6/lib/active_record/connection_adapters/mysql2_adapter.rb:14:in `new'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.6/lib/active_record/connection_adapters/mysql2_adapter.rb:14:in `mysql2_connection'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:228:in `new_connection'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:236:in `checkout_new_connection'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:190:in `block (2 levels) in checkout'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:186:in `loop'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:186:in `block in checkout'
    from /Users/fred/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:185:in `checkout'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:93:in `connection'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:316:in `retrieve_connection'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:97:in `retrieve_connection'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:89:in `connection'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.3/lib/active_record/base.rb:1330:in `replace_bind_variables'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.3/lib/active_record/base.rb:1317:in `sanitize_sql_array'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.3/lib/active_record/base.rb:1224:in `sanitize_sql_for_conditions'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.3/lib/active_record/relation/query_methods.rb:206:in `build_where'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.3/lib/active_record/relation/query_methods.rb:77:in `where'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.3/lib/active_record/base.rb:441:in `where'
    from /Users/fred/Desktop/FireDemon/app/models/user.rb:14:in `<class:User>'
    from /Users/fred/Desktop/FireDemon/app/models/user.rb:1:in `<top (required)>'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:454:in `load'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:454:in `block in load_file'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:596:in `new_constants_in'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:453:in `load_file'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:340:in `require_or_load'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:491:in `load_missing_constant'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:183:in `block in const_missing'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:181:in `each'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:181:in `const_missing'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.3/lib/active_support/inflector/methods.rb:124:in `block in constantize'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.3/lib/active_support/inflector/methods.rb:123:in `each'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.3/lib/active_support/inflector/methods.rb:123:in `constantize'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.3/lib/active_support/core_ext/string/inflections.rb:43:in `constantize'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activemodel-3.0.3/lib/active_model/observing.rb:182:in `observed_class'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activemodel-3.0.3/lib/active_model/observing.rb:175:in `observed_classes'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activemodel-3.0.3/lib/active_model/observing.rb:195:in `observed_classes'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activemodel-3.0.3/lib/active_model/observing.rb:191:in `initialize'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.3/lib/active_record/observer.rb:96:in `initialize'
    from /Users/fred/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/singleton.rb:109:in `new'
    from /Users/fred/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/singleton.rb:109:in `block in instance'
    from <internal:prelude>:10:in `synchronize'
    from /Users/fred/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/singleton.rb:107:in `instance'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activemodel-3.0.3/lib/active_model/observing.rb:66:in `instantiate_observer'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activemodel-3.0.3/lib/active_model/observing.rb:39:in `block in instantiate_observers'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activemodel-3.0.3/lib/active_model/observing.rb:39:in `each'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activemodel-3.0.3/lib/active_model/observing.rb:39:in `instantiate_observers'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.3/lib/active_record/railtie.rb:83:in `block (2 levels) in <class:Railtie>'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:26:in `on_load'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.3/lib/active_record/railtie.rb:82:in `block in <class:Railtie>'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:34:in `call'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:34:in `execute_hook'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:42:in `each'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.3/lib/rails/application/finisher.rb:46:in `block in <module:Finisher>'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `instance_exec'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `run'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.3/lib/rails/initializable.rb:50:in `block in run_initializers'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `each'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `run_initializers'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.3/lib/rails/application.rb:134:in `initialize!'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.3/lib/rails/application.rb:77:in `method_missing'
    from /Users/fred/Desktop/FireDemon/config/environment.rb:5:in `<top (required)>'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `block in require'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `block in load_dependency'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:596:in `new_constants_in'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `load_dependency'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
    from /Users/fred/Desktop/FireDemon/config.ru:3:in `block in <main>'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
    from /Users/fred/Desktop/FireDemon/config.ru:1:in `new'
    from /Users/fred/Desktop/FireDemon/config.ru:1:in `<main>'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/builder.rb:35:in `eval'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/builder.rb:35:in `parse_file'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/server.rb:162:in `app'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/server.rb:248:in `wrapped_app'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/server.rb:213:in `start'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.3/lib/rails/commands/server.rb:65:in `start'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.3/lib/rails/commands.rb:30:in `block in <top (required)>'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.3/lib/rails/commands.rb:27:in `tap'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.3/lib/rails/commands.rb:27:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'
MacPro:FireDemon fred$ 

8 个解决方案

#1


15  

Seems like your user cannot connect to the MySQL DB. Try these commands in your console:

看起来你的用户无法连接到MySQL数据库。在您的控制台中尝试以下命令:

mysql -u root -p

And when prompted, give the password as 'admin'

提示时,将密码作为“admin”

If this is possible, then you should be good to go.

如果这是可能的,那么你应该走了。

#2


12  

The password is wrong for the root user in your config/database.yml file. You can always use the mysqladmin command to change the root user's password if you forgot it.

配置/数据库中的根用户密码错误。yml文件。如果忘记了根用户的密码,您可以使用mysqladmin命令来更改根用户的密码。

#3


2  

Handy home hint - I was stuck on this too but found that loopback (127.0.0.1) != 'localhost'... I had host: 127.0.0.1 and was seeing this exact problem. A quick change to 'localhost' fixed this for me... hope it helps someone.

便利的home提示——我也被困在这里,但是我发现loopback (127.0.0.1) != 'localhost'…我有主机:127.0.0.1,看到了这个问题。快速切换到“localhost”为我修复了这个……希望它能帮助一些人。

development:
 adapter: mysql2
 database: mydb
 host: localhost
 username: root
 password: mypass

#4


1  

The answer is in your question > MYSQL error Access denied for user 'root@localhost'

答案在你的问题> MYSQL错误访问被拒绝的用户" root@localhost "

Apply root user with admin password to your group_chat_development MySQL database

向group_chat_development MySQL数据库应用具有管理密码的根用户

update It occurs to me that you may not wish to be using msQL at all for your dev and test databases in which case change you database.yml file test and development settings to

更新我想到,您可能根本不希望在开发和测试数据库中使用msQL,在这种情况下,更改数据库。yml文件测试和开发设置

# SQLite version 3.x
#   gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
  adapter: sqlite3
  database: db/development.sqlite3
  pool: 5
  timeout: 5000

# 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: sqlite3
  database: db/test.sqlite3
  pool: 5
  timeout: 5000

If you do not know how to use MySQL tools then you should get used to using them very soon as you most likely will need them in your production server environment You will find links to the relevant version on MySQL that you are using here http://dev.mysql.com/doc/ Use MySQL Administrator to set your user permissions.

如果你不知道如何使用MySQL工具,那么你应该习惯使用他们很快当你最有可能会需要它们在生产服务器环境中你会发现链接到相关的版本在MySQL,您正在使用http://dev.mysql.com/doc/使用MySQL管理员来设置用户权限。

#5


0  

If you are setting mysql root password for the first time then type following commands as follow:

如果您是第一次设置mysql根密码,请输入以下命令:

mysqladmin password

mysqladmin密码

You will be Prompted for new password and confirm password.

您将被提示输入新的密码和确认密码。

After confirmation try to login with user root and password which you have just set.

确认之后,尝试使用刚刚设置的用户根和密码登录。

mysql root@'your-new-password'

mysql root@“新密码”

Note : You must login as a root then only you will be able to set the mysql password.

注意:您必须以root身份登录,然后才能设置mysql密码。

Thanks.

谢谢。

#6


0  

So i was stuck with the for a while.

所以我被困了一段时间。

CHECK the file config/database.yml and check your settings.

检查配置文件/数据库。yml,检查你的设置。

default: &default
  adapter: mysql2
  encoding: utf8
  pool: 5
  username: root
  password: root
  socket: ( check what your socket location is by typing mysqladmin version into termnal)

Then Go into terminal and type

然后进入终端输入

mysql -u root -p

And FINALLY Close terminal and re open it, then

最后关闭终端,重新打开

bundle instal

then

然后

rails s

It seams like you have to bundle install again for the changes to take place.

它的接缝就像您必须重新打包安装以进行更改。

Hope that helps!

希望会有帮助!

#7


-1  

you should give the " host: " field in the devlepment in database.yml file. that host name must be " IP " address,like "127.0.0.1" or some thing.. ie " host: 127.0.0.1 " and again restart the server and type on the address like ' 127.0.0.1:3000 ' here 3000 is the port nomber...

您应该在数据库的开发中给出“host:”字段。yml文件。主机名必须是“IP”地址,如“127.0.0.1”或其他地址。ie“主机:127.0.0.1”,然后重新启动服务器,在地址上输入“127.0.0.1:3000”,这里是端口编号…

#8


-1  

If you installed using the oracle package, try login your mysql by

如果使用oracle包安装,请尝试登录mysql

mysql -u username

Then run

然后运行

FLUSH PRIVILEGES;

Then set your password

然后设置你的密码

SET PASSWORD FOR 'username'@'localhost' = PASSWORD('[password]');

#1


15  

Seems like your user cannot connect to the MySQL DB. Try these commands in your console:

看起来你的用户无法连接到MySQL数据库。在您的控制台中尝试以下命令:

mysql -u root -p

And when prompted, give the password as 'admin'

提示时,将密码作为“admin”

If this is possible, then you should be good to go.

如果这是可能的,那么你应该走了。

#2


12  

The password is wrong for the root user in your config/database.yml file. You can always use the mysqladmin command to change the root user's password if you forgot it.

配置/数据库中的根用户密码错误。yml文件。如果忘记了根用户的密码,您可以使用mysqladmin命令来更改根用户的密码。

#3


2  

Handy home hint - I was stuck on this too but found that loopback (127.0.0.1) != 'localhost'... I had host: 127.0.0.1 and was seeing this exact problem. A quick change to 'localhost' fixed this for me... hope it helps someone.

便利的home提示——我也被困在这里,但是我发现loopback (127.0.0.1) != 'localhost'…我有主机:127.0.0.1,看到了这个问题。快速切换到“localhost”为我修复了这个……希望它能帮助一些人。

development:
 adapter: mysql2
 database: mydb
 host: localhost
 username: root
 password: mypass

#4


1  

The answer is in your question > MYSQL error Access denied for user 'root@localhost'

答案在你的问题> MYSQL错误访问被拒绝的用户" root@localhost "

Apply root user with admin password to your group_chat_development MySQL database

向group_chat_development MySQL数据库应用具有管理密码的根用户

update It occurs to me that you may not wish to be using msQL at all for your dev and test databases in which case change you database.yml file test and development settings to

更新我想到,您可能根本不希望在开发和测试数据库中使用msQL,在这种情况下,更改数据库。yml文件测试和开发设置

# SQLite version 3.x
#   gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
  adapter: sqlite3
  database: db/development.sqlite3
  pool: 5
  timeout: 5000

# 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: sqlite3
  database: db/test.sqlite3
  pool: 5
  timeout: 5000

If you do not know how to use MySQL tools then you should get used to using them very soon as you most likely will need them in your production server environment You will find links to the relevant version on MySQL that you are using here http://dev.mysql.com/doc/ Use MySQL Administrator to set your user permissions.

如果你不知道如何使用MySQL工具,那么你应该习惯使用他们很快当你最有可能会需要它们在生产服务器环境中你会发现链接到相关的版本在MySQL,您正在使用http://dev.mysql.com/doc/使用MySQL管理员来设置用户权限。

#5


0  

If you are setting mysql root password for the first time then type following commands as follow:

如果您是第一次设置mysql根密码,请输入以下命令:

mysqladmin password

mysqladmin密码

You will be Prompted for new password and confirm password.

您将被提示输入新的密码和确认密码。

After confirmation try to login with user root and password which you have just set.

确认之后,尝试使用刚刚设置的用户根和密码登录。

mysql root@'your-new-password'

mysql root@“新密码”

Note : You must login as a root then only you will be able to set the mysql password.

注意:您必须以root身份登录,然后才能设置mysql密码。

Thanks.

谢谢。

#6


0  

So i was stuck with the for a while.

所以我被困了一段时间。

CHECK the file config/database.yml and check your settings.

检查配置文件/数据库。yml,检查你的设置。

default: &default
  adapter: mysql2
  encoding: utf8
  pool: 5
  username: root
  password: root
  socket: ( check what your socket location is by typing mysqladmin version into termnal)

Then Go into terminal and type

然后进入终端输入

mysql -u root -p

And FINALLY Close terminal and re open it, then

最后关闭终端,重新打开

bundle instal

then

然后

rails s

It seams like you have to bundle install again for the changes to take place.

它的接缝就像您必须重新打包安装以进行更改。

Hope that helps!

希望会有帮助!

#7


-1  

you should give the " host: " field in the devlepment in database.yml file. that host name must be " IP " address,like "127.0.0.1" or some thing.. ie " host: 127.0.0.1 " and again restart the server and type on the address like ' 127.0.0.1:3000 ' here 3000 is the port nomber...

您应该在数据库的开发中给出“host:”字段。yml文件。主机名必须是“IP”地址,如“127.0.0.1”或其他地址。ie“主机:127.0.0.1”,然后重新启动服务器,在地址上输入“127.0.0.1:3000”,这里是端口编号…

#8


-1  

If you installed using the oracle package, try login your mysql by

如果使用oracle包安装,请尝试登录mysql

mysql -u username

Then run

然后运行

FLUSH PRIVILEGES;

Then set your password

然后设置你的密码

SET PASSWORD FOR 'username'@'localhost' = PASSWORD('[password]');