Replace the username and password in the mysql-proxy read_auth Method

Source: Internet
Author: User

In the mysql-proxy read_auth method, replace the username and password in the mysql-proxy read_auth method to replace the username and password sent from the client with the real user name and password, for example, replace reapcript/me with root/root. The most important part is to call the to_response_packet method to generate a data packet and send it to the database for verification. Mysql-proxy 0.8.3 is written in the following Java code: proxy. queries: append (1, proto. to_response_packet ({username = "root", response = password. scramble (s. scramble_buffer, password. hash ("secret")}) return proxy. PROXY_SEND_QUERY added the server_capabilities attribute to the mysql-0.8.3 version of the api, and the above Program reported the following error message: Java code :. server_capabilities has to be set must be rewritten to the following form: Java code: local protocol_41_default_capabilities = 8 + 512 + 32768 -- 8 + --_ CONNECT_WITH_DB -- 512 + -- _ PROTOCOL_41 -- 32768 -- _ SECURE_CONNECTION Java code: proxy. queries: append (1, proto. to_response_packet ({username = "root", response = password. scramble (scramble_buffer, password. hash ("root"), server_capabilities = protocol_41_default_capabilities}) was troubled by this problem for three or four days and finally solved.

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.