![](/img/trans.png)
[英]“Access denied for user 'root'@'localhost'” on a fresh install of MySQL 5.6.15 on Windows after uninstalling an older version of MySQL
[英]MySQL on Windows - Access denied for user 'root'@'localhost' after fresh install
我已经在 Windows 10 Pro 上安装了最新的 MySQL。 我包含了设置初始值的向导步骤,并选择将其设置为开发机器。 我将所有内容都保留为默认值。 安装并重新启动机器后,似乎无法连接到数据库。
I get the MySQL Error 1045: Access denied for user 'root'@'localhost' (using password: YES)
error both in MySQL Workbench as well as the MySQL Shell.
我尝试在my.ini
中设置skip-grant-tables
,因为这里有很多答案。 当我设置它并尝试启动 MySQL80 服务时,它会在几秒钟内再次关闭。
我也尝试按照这个答案从mysqld.exe --skip-grant-tables
开始,但这给了我一个错误,即它找不到C:\Program Files\MySQL\MySQL Server 8.0\data
。 这个文件夹确实不存在,在我自己创建这个文件夹并再次运行mysqld.exe --skip-grant-tables
之后,3个文件被添加到这个文件夹但我立即被扔回我的 CMD shell 并且没有 mysqld.exe进程正在运行。
重申一下,这是一台 Windows 10 机器,不幸的是,关于sudo mysql
或/etc/my.conf
的答案不适用。
Workbench、MySQL Shell 和 CMD Prompt 在上述步骤中都以管理员身份运行。
您是否尝试使用“-p”和密码“password”?
重新安装 MySQL 与旧式身份验证和它会接受的最弱密码,现在它可以工作了...... ¯\_(ツ)_/¯
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.