Newly built MySQL is prone to problems

Source: Internet
Author: User

1, the maximum number of connections exceeded the problem. Mysql:error 1040:too Many connections  the number of database connections is not temporary change, the middle of the default 151 login Mysql-uroot-proot set the number of connections sets GLOBAL Max_connections = 1000; View maximum connection pool select Variable_value from INFORMATION_SCHEMA. Global_variables where variable_name= ' max_connections ';  2, database error user name password wrong that is really account password, there may be because of a lot of space caused by eg: "Root  " This will be an error   3, MySQL 8 hours after idle connection timeout problem view parameters show variables like '%timeout% '; note interactive_timeout         | 28800wait_timeout                | 28800 the two parameters below are the default time 60*60*8=28800 (8 hours)   But this way to change the database properties, when the deployment of a server to configure the database properties, it is best to resolve the solution in the program: Configure the c3p0<!-- The maximum number of connections that are kept in the connection pool. Default: 15 --> <property name= "Maxpoolsize" value= "3"/> < the minimum number of connections left in the!--  connection pool by default    --><property name= "Minpoolsize" value= "2"/> <!--initialize the number of connections in the connection pool, The value should be between Minpoolsize and Maxpoolsize, the default is 3--> <property name= "Initialpoolsize" value= "2"/>  < !--maximum idle time, unused in 60 seconds, the connection is discarded. If 0, it will never be discarded. Default value: 0-->   <property name= "MaxIdleTime" value= "/>  <!--when the connection pool connection is exhausted, the client calls getconnection () Wait for the time to get the new connection after the timeout will be thrown SqlException, if set to 0 wait indefinitely. Unit milliseconds. Default: 0-->   <property name= "checkouttimeout" value= "" "/>  <!-- When the connection in the connection pool runs out, c3p0 the number of connections that are fetched at one time. Default value: 3-->   <property name= "Acquireincrement" value= "2"/>  <!-- Defines the number of repeated attempts to obtain a new connection from the database after a failure. Default value: 30, less than or equal to 0 means infinite-->   <property name= "acquireretryattempts" value= "0"/>  <!-- Retry interval, default: 1000 ms-->   <property name= "Acquireretrydelay" value= ""/>  <!-- If the connection is closed, commit uncommitted transactions, default to False, close the connection, roll back uncommitted transactions-->   <property name= "Autocommitonclose" value= "false"/ >  <!--C3P0 will build a blank table named Test and test it with its own query statement. If this parameter is defined, then the attribute preferredtestquery will be ignored. You cannot do anything on this test sheet, it will be used only for C3P0 testing. Default value: null-->   <property name= "automatictesttable" value= "Test"/>  <!--if False, Failure to get a connection will cause all waiting pools to getThe connected thread throws an exception, but the data source is still valid and continues to attempt to get the connection the next time getconnection () is called. If set to True, the data source will declare broken and permanently shut down after attempting to acquire a connection failure. Default: false --> <property name= "Breakafteracquirefailure" value= "false"/>  <!-- Check for idle connections in all connection pools every 60 seconds. Default value: 0, do not check-->   <property name= "Idleconnectiontestperiod" value= "/> <"!-- C3P0 the size of the global preparedstatements cache. If both maxstatements and maxstatementsperconnection are 0, the cache does not take effect, and if one is not 0, the statement's cache will take effect. If the default value: 0-->   <property name= "maxstatements" value= "" "/><!-- Maxstatementsperconnection defines the maximum number of cache statements that a single connection in a connection pool has. Default value: 0-->   <property name= "maxstatementsperconnection" value= "0" ></property> 4, Version of MySQL  -V   

Newly built MySQL is prone to problems

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.