Kurinchi Blogger Scribbles …


Posts Tagged ‘MySql’

Aug 09
2014

MySQL Error: Got a packet bigger than ‘max_allowed_packet’ bytes

Last updated: September 9th, 2014

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

Apr 04
2014

Mysql: Another MySQL daemon already running with the same unix socket.

Last updated: April 4th, 2014

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

Jul 09
2013

How to setup, install Apache, PHP and MySQL on Mac OS?

Last updated: July 9th, 2013

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
(more…)

Mar 17
2013

How to fix Hibernate MySql connection timeout issue (solved)?

Last updated: June 14th, 2013

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
(more…)

Nov 24
2012

How to find the port used by mysql?

Last updated: November 24th, 2012

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
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
skip-networking

[mysql.server]
user=mysql
basedir=/var/lib

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

$ service mysqld restart

Oct 01
2012

How to install Ruby, Rails and MySQL on Ubuntu Server?

Last updated: October 1st, 2012

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.
(more…)

Mar 26
2011

MySQL: Default collation latin1_swedish_ci (swedish case insensitive)

Last updated: March 26th, 2011

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

Edit my.cnf:
[mysqld]
collation_server=latin1_general_ci

(more…)

Jan 09
2011

MySQL Database Error: Error 28 from Storage engine

Last updated: January 9th, 2011

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.

May 20
2010

MySQL GUI tool for Data Management

Last updated: May 20th, 2010

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.

This runs on windows platforms – WinXP/XP7 and you can download HeidiSQL from Download link
(more…)

Apr 05
2010

How to import mysql dump (.gz or .sql) into a database?

Last updated: April 6th, 2010

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.
(more…)


Valid HTML 4.01 Strict  Valid HTML 4.01 Strict