views:

109

answers:

4

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');
+3  A: 

Are you passing an ANSI string where a UNICODE string is expected?

jeffamaphone
+1  A: 

wrong charset :P

n00b32
A: 

Refer this link link text

santosh
Not sure how that helps...
DilbertDave
+3  A: 

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.

bobince
Bingo - It was actually an underscore. I replaced the underscore and voila!
Keith Donegan
An underscore? Hmm! I guess it depends on the editor what the character would look like, but normally two LEFT-TO-RIGHT-MARKs would be invisible. Windows-1250 (Central European) is another codepage that would make U+200E to that sequence; the only other possible encoding I can find is ISO-8859-15 and -16, where it would be U+2934 ARROW POINTING RIGHTWARDS THEN CURVING UPWARDS: ⤴⤴
bobince