1. Install mysql,
2. Install MyODBC-standard-3.51.07-win.msi
3: The vb connection statement is:
Public strcnn As StringPublic SQL As String
Public conn As New ADODB. Connection
Public rs As New ADODB. Recordset
Sub link ()
Strcnn = "driver = {MySQL ODBC 3.51 Driver}; server = localhost; database = data; uid = root; pwd = zjb" conn. Open strcnn
End Sub
MySQL returns an error: #1251-Client does not support authentication protocol requested by server; consider upgrading MySQL client
This problem occurs only in MySQL 4.1.x and later versions, so we can use 4.0.x.
The reason is that the new password verification mechanism is used in the mysql server version, which requires the client version to be later than 4.0. The original password function is changed to old_password ();, in this way, it is difficult to use the password () generated by the client in the old version, while the MYSQL client in PHP is 3.23 (except for mysqli extension ), this is the problem.
1. Go to the command line, go to the BIN directory of the MYSQL directory, and enter the MYSQL Command Line Mode:
Example: d: \ mysql \ bin> mysql-uroot-p123 User root, password 123)
2. Enter the command: mysql> set password for 'root' @ 'localhost' = old_password ('123'); (note that the number of colons is not small)
3. Return the MYSQL command line: mysql> q
OK