我无法在Ubuntu 20.04的MySQL Workbench中打开本地实例,安装了MySQL Server。我在这里搜索了一些类似的主题,但这些主题无济于事。
找到解决方案:
我找到了解决这个问题的解决方案。这是因为MySQL Workbench无法将密码存储在钥匙扣中,也因为它未能在127.0.0.0.1:3306连接到MySQL,而用户根访问拒绝用户'root'@'localhost'(使用密码:是)。
在终端中使用此命令: sudo snap connect mysql-workbench-community:password-manager-service:password-manager-service
。
快照软件包像往常一样是沙盒,默认情况下不允许访问该服务。当我们选择“在钥匙链中存储”选项时,MySQLWorkBench将被Apparmor阻止。这就是为什么我们需要输入命令以允许软件包访问服务的原因。
帮助我的解决方案链接:
无法在127.0.0.0.1:3306连接到MySQL,用户root访问拒绝用户'root'@'localhost'(使用密码:是)

I cannot open the local instance in MySQL Workbench in Ubuntu 20.04 after installing the MySQL server. I searched for some similar topics here but these did not help.
Solution Found:
I've found the solutions for this problem. This was because of the MySQL Workbench couldn't store password in keychain and also because it failed to connect to mysql at 127.0.0.1:3306 with user root access denied for user 'root'@'localhost'(using password:YES).
Use this command in the terminal: sudo snap connect mysql-workbench-community:password-manager-service :password-manager-service
.
The snap package is sandboxed as usual and is not by default allowed to access the service. MySQLWorkbench is blocked by AppArmor when we choose "Store in keychain" option. That's why we need to enter the command to allow the package to access the service.
The solution links that helped me:
MySQL Workbench not saving passwords in keychain
Failed to connect to mysql at 127.0.0.1:3306 with user root access denied for user 'root'@'localhost'(using password:YES)
发布评论
评论(3)
我在这里需要做的所有要做的是主要在终端中输入以下命令:
sudo snap connect mysql-workbench-community:password-manager-service:password-manager-service
在这里,snap package是沙盒像往常一样,默认情况下不允许访问服务。当我们选择“在钥匙链中存储”选项时,MySQLWorkBench将被Apparmor阻止。这就是为什么我们需要输入命令以允许软件包访问服务的原因。
All I need to do here is mainly type the following command in the terminal:
sudo snap connect mysql-workbench-community:password-manager-service :password-manager-service
Here, the snap package is sandboxed as usual and is not by default allowed to access the service. MySQLWorkbench is blocked by AppArmor when we choose "Store in keychain" option. That's why we need to enter the command to allow the package to access the service.
尝试添加此步骤。
登录端子中的mySQL
执行此命令
alter用户'root'@'localhost'用mysql_native_password通过'password';
检查是否解决了您的问题<注意“密码”部分,将其更改为要使用>
的密码
我尝试了上述所有步骤,这是为我解决的一个步骤。
Try adding this step.
login to mysql in the terminal
execute this command
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
Check if this solved your problem <NOTE THE 'password' PART, CHANGE IT TO THE PASSWORD YOU WANT TO USE>
I tried all of the above steps, this one was the one that solved for me.
确保所有提到的事情有效。
首先检查MySQL通过在下面运行的命令以下运行:
sudo Systemctl状态mysql
如果运行,请确保您的mySQL用户名是root且您要输入的密码是正确的。如果仍然不起作用,请确保您已将所有特权授予用户“ root”。
如果不知道如何设定特权,请仔细阅读本文。
Make sure all the mentioned things working.
First check mysql is running by running below command:
sudo systemctl status mysql
If it's running make sure that your mysql username is root and password you are entering is correct. If still not working make sure you have given all the privileges to user "root".
If don't know how to set privileges read this article carefully.
https://docs.rackspace.com/support/how-to/install-mysql-server-on-the-ubuntu-operating-system/