无法使用我最近在 MySQL 中添加的用户连接到数据库
我正在尝试向 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你可能需要运行
You may need to run
具体来说,您遇到了什么错误?没有权限?无法连接?将连接线更改为以下内容:
并查看吐出什么错误。如果权限被拒绝,则说明您的用户配置不正确(可能是用户名、主机名或密码不正确)。连接被拒绝将是 MySQL 不允许通过 TCP 进行连接。
What error are you getting, specifically? Permission denied? Can't connect? Change your connection line to the following:
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.