8

一切正常,我有 Windows 8 和 MySQL 5.6 工作台。

昨天,我升级到了 Windows 8.1,这让 PC 运行得更好,但把 MySQL 搞砸了。

当我进入工作台时,我可以看到我的旧连接,但是通过单击它,我得到:

Cannot Connect to Database Server
Your connection attempt failed for user 'root' from your host to server at 
127.0.0.1:3306:Can't connect to mysql server on '127.0.0.1'(10061)
Please:
 1. Check that mysql is running on server 127.0.0.1
 2. Check that mysql is running on port 3306 (note: 3306 is the default, but this can be changed)
 3. Check the root has rights to connect to 127.0.0.1 from your address (mysql rights define what clients can connect to the server and from which machines) 
 4. Make sure you are both providing a password if needed and using the correct password for 127.0.0.1 connecting from the host address you're connecting from the host address you're connecting from.
4

4 回答 4

5

好吧,卸载工作台并重新安装它就可以了。未删除所有架构

于 2013-10-22T10:28:56.660 回答
2

重新安装 mysqld 服务确实会让数据库服务器重新启动,但是您会发现您的数据库丢失了,您的所有用户详细信息也丢失了!

在 Windows 8 下,MySQL 将其数据库存储在 C:\ProgramData\MySQL\MySQL Server 5.5\data 下,而在 8.1 下它全部移动到 C:\Program Files\MySQL\MySQL Server 5.5\data。

对此的快速解决方案是:

  • 通过任务栏中的 MySQL Notifier 停止 mysqld 服务
  • 将 C:\ProgramData\MySQL\MySQL Server 5.5 复制到 C:\Program Files\MySQL\MySQL Server 5.5
  • 通过通知程序重新启动 mysqld 服务。

嘿 presto,您的数据库和用户凭据又回来了。

于 2013-11-13T08:55:14.920 回答
2

升级到 Windows 8.1 后,您需要运行 MySQL 配置向导

http://dev.mysql.com/doc/refman/5.1/en/mysql-config-wizard-starting.html

但我无法让它工作,所以不得不重新安装 MySQL 服务器。

然后将其安装为服务,并指向我早期的数据库:

mysqld --install MySQL --defaults-file=C:\MySQL\data\my.ini

通过运行检查它是否正常工作

mysql -u username -p password
show databases;
于 2013-11-14T11:24:24.080 回答
2

就我而言,缺少 mysql 的服务。使用以下命令重新安装服务:

mysqld --install [Instance Name] --defaults-file=[My SQL Configuration File]

因此,如果我安装的服务MySQL是实例名称,并且D:\MySQL\my.ini是我以前的配置文件,我执行以下命令:

mysqld --install MySQL --defaults-file="D:\MySQL\my.ini"

然后像往常一样启动服务。这应该够了吧。

注意:您必须在具有提升权限的命令提示符下执行这些命令。

于 2013-12-03T09:14:44.997 回答