ID: 48293
User updated by: aaa_whoknows_me at list dot ru
Reported By: aaa_whoknows_me at list dot ru
-Status: Feedback
+Status: Open
Bug Type: MySQL related
Operating System: Windows
PHP Version: 5.3.0RC2
New Comment:
>$conn = new mysqli(); // no params, no connection
>$conn->options(MYSQLI_SET_CHARSET_NAME, "yourcharset");
>$conn->connect("host", "user", "pass"...);
Unfortunatly, it didn't help. I tried to use utf8, utf-8, ucs2, utf16,
utf-16 and I sent username in all these charsets in all possible
combinations but it didn't work anyway.
Previous Comments:
------------------------------------------------------------------------
[2009-05-18 16:34:02] [email protected]
mysqlnd doesn't read the configuration files of MySQL. Calling these
doesn't result in an error but it is a no-op.
Please file a documentation bug!
Thanks
------------------------------------------------------------------------
[2009-05-18 15:27:36] carsten_sttgt at gmx dot de
Just a question:
> mysqlnd (5.3.0) doesn't read the my.ini/my.cnf at all,
> thus also not the [mysql] section.
>
> You can overcome mysql's behavior by doing something like
> $conn->options(MYSQLI_SET_CHARSET_NAME, "yourcharset");
The Options "MYSQLI_READ_DEFAULT_FILE" and "MYSQLI_READ_DEFAULT_GROUP"
are still available with mysqlnd?
If yes, you should also change the description at [1].
--> "instead of my.cnf" += " or none as of 5.3.10 with mysqlnd"
If no:
--> "only available with libmysql"
(IMHO there is an other place in the docu, which also describe these
options.)
Regards,
Carsten
[1] http://de.php.net/manual/en/mysqli.options.php
------------------------------------------------------------------------
[2009-05-18 14:57:04] [email protected]
mysqlnd (5.3.0) doesn't read the my.ini/my.cnf at all, thus also not
the [mysql] section. Yes, mysqlnd set the charset of the connection to
be the charset of the server sent during the handshake. In the greeting
packet the server says which its default charset is. The server
interprets the username in the the charset sent by the client.
Libmysql doesn't look at what the server advertises but uses its own
charset, sometimes pulled from the config, sometimes what is set through
mysql_options - depends how used.
You can overcome mysql's behavior by doing something like
$conn = new mysqli(); // no params, no connection
$conn->options(MYSQLI_SET_CHARSET_NAME, "yourcharset");
$conn->connect("host", "user", "pass"...);
HTH,
Andrey
------------------------------------------------------------------------
[2009-05-16 15:14:52] aaa_whoknows_me at list dot ru
It applies only to PHP 5.3.0 and higher. Now I'm using PHP 5.2.9-2 for
Windows and it is able to connect to the same MySQL server.
------------------------------------------------------------------------
[2009-05-15 17:26:34] [email protected]
Just to make sure: This does not happen with PHP 5.2.9 ??
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/48293
--
Edit this bug report at http://bugs.php.net/?id=48293&edit=1