When trying to import large SQL dump, you often get the above message. Remedy for this issue is to increase the packet size of MySQL’s daemon by setting a packet size of max_allowed_packet. Sudo to your account and set the following
root $ mysql -u admin -p
mysql> set global net_buffer_length=1000000;
mysql> set global max_allowed_packet=1000000000;
In the command line, issue the command
$ mysql –max_allowed_packet=128M -uUSER -pPASSWORD database < database.sql.dump
After VPS reboot, you may encounter this issue and the fix is simple. Follow these stops to prevent this error.
$ service mysqld stop
$ mv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock.bak
$ service mysqld start
Apache server is installed by default on Mac. Access the configuration settings for Apache by going to
$ cd /etc/apache2/
$ vi httpd.conf
To enable php, edit httpd.conf and uncomment the line
#LoadModule php5_module libexec/apache2/libphp5.so
Uncomment other lines that you may want to load in your system. As you are enabling PHP in your system, you may want to change the DirectoryIndex to
DirectoryIndex index.php index.html
Default group/user settings inside Apache on Mac is _www:_www
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
List the listening ports and check if mysql is listed on it.
$ netstat -tln | grep mysql
If you cannot find the port number for mysql view my.cnf file to see if you can find the port number. If you see a line “skip-networking” try commenting out the line and then restart mysql daemon.
$ vi /etc/my.cnf[mysqld] set-variable=local-infile=0
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
skip-networking [mysql.server] user=mysql
basedir=/var/lib [mysqld_safe] log-error=/var/log/mysqld.log
$ service mysqld restart
For this tutorial we will be using Ruby 1.9.3 and Rails 3.2.1
First thing update
$ sudo apt-get update
Next, we are going to install git, RVM which is essential for the build
$sudo apt-get install build-essential git-core curl
RVM stands for Ruby Version Manager that is used for installing and managing multiple versions of Ruby at one point of time.
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 for the error is the availability of space allocated to the MySQL database in the specified partition.
Easy fix for this is to go to the PhpMyAdmin interface (via CPanel/WHM) and identify the tables which has some value in under overhead column. Select ALL those tables and choose the option “Repair table” after you ensure that there is enough space in the database.
HeidiSQL – a comprehensive tool for MySQL management which is available for Free.
Manage data tables, export/import databases, synchronise tables between databases, integrity check, database backup service management, edit database content and many more features packaged as a solution for ALL your MySQL needs.
When moving mysql database from one server to another or, to test that the data backup works as expected we need to import mysql dump file in the testing environment.
Create the database (test-database) in the testing environment and identify the location of the .gz or .sql file.
If the mysql dump was a .gz file, you need to gunzip to uncompress the file by typing
$ gunzip mysqldump.sql.gz
This will uncompress the .gz file and will just store mysqldump.sql in the same location.