简体   繁体   English

无法连接到MySql Server,无法重新配置MySql Server

[英]Can't connect to MySql Server and can't reconfigure MySql server

I had problem with connection to database in my Rails application, so reinstalled everything according to this tutorial , and it doesn't help.我在 Rails 应用程序中连接到数据库时遇到问题,因此根据本教程重新安装了所有内容,但没有帮助。

Now when I'm running the installation of MySql Server it says:现在,当我运行 MySql Server 的安装时,它说:

error 1045 Access denied for 'root@localhost'(using password NO)错误 1045 拒绝访问“root@localhost”(使用密码 NO)

When I was reconfiguring leaved the field old password empty.当我重新配置时,将旧密码字段留空。 How I can solve this ?我该如何解决这个问题? Here is my log:这是我的日志:

Can't connect to MySQL server on 'localhost' (10061)无法连接到“本地主机”上的 MySQL 服务器 (10061)

Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "reconnect"=>false, "database"=>"testapp_development", "pool"=>5, "username"=>"root", "password"=>"root", "host"=>"localhost"}, charset: , collation: Can't connect to MySQL server on 'localhost' (10061)无法为 {"adapter"=>"mysql2", "encoding"=>"utf8", "reconnect"=>false, "database"=>"testapp_development", "pool"=>5, "username" 创建数据库"=>"root", "password"=>"root", "host"=>"localhost"}, charset: , collat​​ion: 无法连接到 MySQL 服务器在 'localhost' (10061)

Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "reconnect"=>false, "database"=>"testapp_test", "pool"=>5, "username"=>"root", "password"=>nil, "host"=>"localhost"}, charset: , collation:无法为 {"adapter"=>"mysql2", "encoding"=>"utf8", "reconnect"=>false, "database"=>"testapp_test", "pool"=>5, "username" 创建数据库"=>"root", "password"=>nil, "host"=>"localhost"}, charset: , collat​​ion:

You mentioned that you left your password empty when you installed MySQL? 您提到您在安装MySQL时将密码留空了吗? But your Rails seems to be trying to connect with the password 'root'. 但是您的Rails似乎正在尝试使用密码“ root”进行连接。 Which is it? 哪有 If your MySQL has a password, you need to use it to connect, and if it doesn't, you mustn't send one. 如果您的MySQL有密码,则需要使用它进行连接;如果没有密码,则不能发送密码。

您好,我也有同样的情况,但您可以通过服务找到它,您只需再次重新启动 MySQL 选项

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM