How to solve the problem of connecting to MySQL using vb

Source: Internet
Author: User
Tags mysql client mysql command line

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.