我有一个全新的WSL2,在最新的Windows 10(2004)上运行,安装了Ubuntu 20.04和MySQL。我可以从Bash访问它并获取状态--
我的WSL2列表是---
我的WSL2信息是---
我尝试使用上面的172.20.109.28,但是出现了相同的错误。
从Windows的角度来看---
我尝试使用上面的172.20.96.1,但是出现了相同的错误。
有一件奇怪的事情是,当我尝试使用root@localhost作为用户名而不仅仅是root时,工作台会弹出“输入密码”的弹窗。我非常兴奋,但是当我将密码字段留空时,它仍然显示密码:NO,登录失败。
我感到非常沮丧,我需要帮助。
mysql> status
--------------
mysql Ver 8.0.20-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu))
Connection id: 10
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 8.0.20-0ubuntu0.20.04.1 (Ubuntu)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8mb4
Db characterset: utf8mb4
Client characterset: utf8mb4
Conn. characterset: utf8mb4
UNIX socket: /var/run/mysqld/mysqld.sock
Binary data as: Hexadecimal
Uptime: 13 sec
接下来我想要连接 MySQL Workbench。 我所得到的一切都是
Your connection failed for user 'root' to the MySQL server at 127.0.0.1:3306
Access denied for user 'root'@'localhost'
我的WSL2列表是---
PS C:\Users\gymdo> wsl -l -v
NAME STATE VERSION
* Ubuntu-20.04 Running 2
我的WSL2信息是---
Installation successful!
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
Welcome to Ubuntu 20.04 LTS (GNU/Linux 4.19.104-microsoft-standard x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of Sat Jun 13 02:35:32 EDT 2020
System load: 1.97 Processes: 8
Usage of /: 0.4% of 250.98GB Users logged in: 0
Memory usage: 0% IPv4 address for eth0: 172.20.109.28
Swap usage: 0%
0 updates can be installed immediately.
0 of these updates are security updates.
我尝试使用上面的172.20.109.28,但是出现了相同的错误。
从Windows的角度来看---
Ethernet adapter vEthernet (WSL):
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::c54a:f83c:a5f8:40b2%43
IPv4 Address. . . . . . . . . . . : 172.20.96.1
Subnet Mask . . . . . . . . . . . : 255.255.240.0
Default Gateway . . . . . . . . . :
我尝试使用上面的172.20.96.1,但是出现了相同的错误。
有一件奇怪的事情是,当我尝试使用root@localhost作为用户名而不仅仅是root时,工作台会弹出“输入密码”的弹窗。我非常兴奋,但是当我将密码字段留空时,它仍然显示密码:NO,登录失败。
我感到非常沮丧,我需要帮助。
sudo mysql
还是mysql -u root -p
开始的? - Kulfy$ service mysql start
然后我使用以下命令访问它:$ mysql -uroot
- Jim Dunnmysql -uroot
前使用sudo
吗?你的密码是空的吗? - Kulfy