How to solve the MySQL proxy problem

Source: Internet
Author: User

Unable to connect to MySQL through MySQL proxy
If the host and password are correct, you may encounter a problem where you cannot connect to MySQL. Check whether the MySQL server uses old_password and whether there is a problem in my. CNF.

Plain text

Code:CopyCodeThe Code is as follows: old_password = 1

Some databases are upgraded from the old version, so this option is enabled. MySQL proxy does not support old_password. You can also check the password length to determine the password length:

Plain text
Code:Copy codeThe Code is as follows: Select length (password) from mysql. User

If the length is 16 bits, It is the old_password.

Garbled characters
After connecting to the database through the proxy, the query string is always garbled, even if you manually execute set names 'utf8', it will not work.

Solution: MySQL server must be set

Plain text
Code:Copy codeThe Code is as follows: [mysqld]
Skip-character-set-client-handshake
Init-connect = 'set names utf8'
Default-character-set = utf8

When a MySQL slave is disabled, the MySQL proxy reports an error and all MySQL instances cannot be connected.
MySQL proxy is installed for read/write splitting, including master x 1 and slave x 2. In order to test the Failover, a server Load balancer instance is stopped, and MySQL proxy always reports an error, prompting that the connection fails. This is worse than single-point mysql. If one is dropped, it will all be dropped! MySQL engineers provided a piece of code to replace the network_mysqld_plugin_proto function of SRC/network-mysqld-proxy.c to solve this problem.

The code is relatively long, directly attached: network-mysqld-proxy-function.c

Regular crash
This problem is also very bad. MySQL proxy often stops working quietly. Fortunately, the interval is very long. I guess there is a memory leakage problem. I hope it can be solved in later versions.

The solution I use is to restart it regularly at night.

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.