Garbled characters encountered during mysql Development

Source: Internet
Author: User


Mysql development encounters garbled issues 1. mysql encounters garbled code www.2cto.com solution: show variables like 'collation _ % '; check whether the encoding is the same as the encoding of data in the program. If not, there are two solutions:

A. B. Set names 'gbk' alter database payment character set GBK; create database mydb character set GBK; set bandwidth = GBK; set character_set_connection = gbk; set character_set_database = gbk; set bandwidth = gbk; set character_set_server = gbk; set character_set_system = gbk; set collation_connection = gbk; set collation_database = gbk; set collation_server = gbk; 2. too required connections error my c3p0 Set the maximum number of connections to 35. After more than 30 accesses, the connection will no longer be accessible. The cause of Too connections error is: I forgot to close the connection !!!!!, Close all OK 3. Differences between using a database connection pool in hibernate and without a database connection pool when not using a database connection pool, I access the Home Page very slowly, the home page needs to wait for the database query content, about 30 ~ 50 seconds !!! After the c3p0 connection pool is added, 4 ~ 10 seconds 4. In tomcat, the database connection is idle for 8 hours by default. If it is not used for 8 hours, the solution will be automatically disabled: a. Restart tomcat. B. Restart mysql and restart. C. Use c3p0 perfect solution (recommended) automatically reconnect when the database connection is closed

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.