如何创建可以联系的用户?

问题描述

MysqL新手在这里

我已经在Windows 10计算机上安装了MysqL,并且可以使用MysqL Workbench以根用户名进行连接,并且一切都按承诺进行。

但是,现在我想创建另一个用户进行连接,并使该用户只能访问服务器上的一个数据库

我已经使用以下命令创建了用户

CREATE USER 'user'@'localhost' IDENTIFIED BY 'f^rest_of_password';
GRANT ALL PRIVILEGES ON wordpress.* TO 'user'@'localhost';
FLUSH PRIVILEGES;

我已经使用以下命令创建了数据库

CREATE DATABASE wordpress

因此,现在我尝试使用该用户密码MysqL Workbench中创建连接,但连接失败。 错误消息显示

Cannot Connect to Database Server

Your connection attempt Failed for user 'user' to the MysqL server at localhost:3306

Please:
1 Check that MysqL is running on address localhost
2 Check that MysqL is reachable on port 3306 (note: 3306 is the default,but this can be changed)
3 Check the user user has rights to connect to loclahost 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 loclahost connecting from the host address you're connecting from

下一步是什么?

谢谢, 欧文

解决方法

我发布一个问题。...

结果是我需要指定自定义的“安装类型”, mysqld的“配置文件部分” 和MySQL80的“ Windows服务名称”

(最终复制了工作的根连接并更改了用户名和密码)。