When we began creating an application using Struts2 framework with Hibernate and MySQL, we ran into a problem which was related to MySQL timing out its connection after a span of 8 hours when left unused. It conceived a lot of time at our end but we were able to nail down the issue at the end.
Steps that we had taken to correct the issue related to Hibernate MySql connection timeout problem are listed below
– Download Hibernate C3P0 and copy .jar files
– Set c3p0.properties
– Make changes to hibernate.cfg.xml
– Test MySQL connection timeout
– Hibernate, MySQL connection timeout related error messages
When transitioning MySQL database from Windows to Linux, users often encounter issues related to case-sensitiveness. Windows is case-insensitive and Linux is case-sensitive.
In such scenarios when a database call is made after the application migration happens, users often run into errors which can send them in circles between the migration servers.
Solution to this problem is to add a single line of text under my.cnf (MySQL configuration file) under [mysqld] Continue Reading…
When new fileds are created as variable characters they get stored as latin1_swedish_ci as default. To change the default collation users will have to manually select the collation of their choice from the mysql admin interface such as in the case of phpmyadmin or will have to denote it in sql queries.
To make a specific collation as the default, other option to give mysql an indication of it by having the needed collation name in my.cnf (mysql configuration) as shown below
Reason why this error might occur:
i) Incomplete MySQL implementation
ii) MySQL setting mis-configuration
root@myserver:/# vi /etc/mysql/my.cnf
Comment out the below line in my.cnf file to make MySQL listen on ALL interfaces
#bind-address = 127.0.0.1
root@myserver:/# netstat -tap | grep mysql
tcp 0 0 *:mysql *:* LISTEN 17785/mysqld
Note that above line which indicates MySQL listening on all interfaces.