无法使用我最近在 MySQL 中添加的用户连接到数据库

发布于 2024-09-14 22:53:46 字数 418 浏览 3 评论 0原文

我正在尝试向 mysql 数据库添加新用户。 文件的原始状态看起来像这样(有效):

$dconex=mysql_connect("200.xxx.xxx.xxx","abong1","XXXXXX");
mysql_select_db("abong1",$dconex);

我试图在 mysql_select_db 之间添加这一行:

$dconex=mysql_connect("200.xxx.xxx.xxx","abong1_abongler","XXXXXXXX");

我在 PhpMyAdmin 中使用正确的 IP、用户名和密码配置了用户,但似乎没有工作。与用户名有关吗?它应该有一个像“abong1.abong1_abongler”这样的“根”吗?

提前致谢。

I'm trying to add a new user to a mysql database.
The original state of the file looks like this (which works):

$dconex=mysql_connect("200.xxx.xxx.xxx","abong1","XXXXXX");
mysql_select_db("abong1",$dconex);

I'm trying to add this line in between the mysql_select_db:

$dconex=mysql_connect("200.xxx.xxx.xxx","abong1_abongler","XXXXXXXX");

I configured the user in PhpMyAdmin with the correct IP, username, and password, but it doesn't seem to work. Is it something about the username? should it have a 'root' like "abong1.abong1_abongler" ?

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

老子叫无熙 2024-09-21 22:53:46

你可能需要运行

flush privileges;

You may need to run

flush privileges;
糖粟与秋泊 2024-09-21 22:53:46

具体来说,您遇到了什么错误?没有权限?无法连接?将连接线更改为以下内容:

$dconex=mysql_connect("200.xxx.xxx.xxx","abong1_abongler","XXXXXXXX") or die(mysql_error());

并查看吐出什么错误。如果权限被拒绝,则说明您的用户配置不正确(可能是用户名、主机名或密码不正确)。连接被拒绝将是 MySQL 不允许通过 TCP 进行连接。

What error are you getting, specifically? Permission denied? Can't connect? Change your connection line to the following:

$dconex=mysql_connect("200.xxx.xxx.xxx","abong1_abongler","XXXXXXXX") or die(mysql_error());

and see what error gets spit out. If it's permission denied, then your user isn't configured properly (could be username, hostname, or password is incorrect). Connection refused would be MySQL not allow connections over TCP.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文