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