警告:mysql_connect():用户“'‎‎u1'”的访问被拒绝?

发布于 2024-08-05 12:41:11 字数 457 浏览 8 评论 0原文

这是非常基本的问题,我很抱歉提出这样一个菜鸟问题。

但我收到此错误:

Warning: mysql_connect(): Access denied for user '‎‎u1'@'172.16.3.139' (using password: YES) in /usr/local/pem/vhosts/103503/webspace/httpdocs/eirestudio-tools/crm/add-contact.php on line 53 

用户说 ‎‎u1?

这意味着什么?

下面是一个示例连接,请注意用户,为什么我会收到 ‎‎u1

mysql_connect('localhost', '‎‎user', 'pass');

This is extremely basic and I apologize for asking such a rookie question.

But I a getting this error:

Warning: mysql_connect(): Access denied for user '‎‎u1'@'172.16.3.139' (using password: YES) in /usr/local/pem/vhosts/103503/webspace/httpdocs/eirestudio-tools/crm/add-contact.php on line 53 

The user says ‎‎u1?

What does this mean?

Here is a sample connection below, note the user, why am I getting ‎‎u1?

mysql_connect('localhost', '‎‎user', 'pass');

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

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

发布评论

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

评论(1

悲凉≈ 2024-08-12 12:41:11

为什么我会得到“u1”?

您期待的只是“u1”吗?您从哪里读取该字符串?

似乎发生的事情是您的配置源中的某处有一些不可见的控制字符。具体来说,当您采用 Unicode U+200E LEFT-TO-RIGHT MARK 并将其编码为 UTF-8,然后使用 Windows-1252 代码页读取它时,会得到字符串“–”。

如果从文本文件中读取用户名“u1”,则可能会发生这种情况:您的程序可能会将其读取为 cp1252(西方机器上的默认代码页)中的字节,但文本编辑器会猜测它是 UTF-8 并将其转换为 UTF-8。字节转换为 U+200E 字符,您将看不到这些字符。我不知道它们最初来自哪里,但您可以尝试重新输入/替换包含“u1”的源以摆脱它们。

why am I getting ‎‎u1?

Were you expecting just ‘u1’? Where are you reading that string from?

What seems to have happened is that you've got some invisible control characters in your config source somewhere. Specifically, the string ‘‎’ is what you get when you take a Unicode U+200E LEFT-TO-RIGHT MARK and encode it into UTF-8, then read it using the Windows-1252 codepage.

This could happen if the username ‘u1’ was being read from a text file: your program might read it as bytes in cp1252 (the default codepage on Western machines), but a text editor would guess it to be UTF-8 and turn those bytes into U+200E characters, which you won't be able to see. I don't know where they originally came from, but you could try re-typing/replacing the source containing ‘u1’ to get rid of them.

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