Mohan Cheema's Online Diary

Site Just to Keep Track of My Day to Day Work.

September 28, 2011
by Mohan Cheema
0 comments

MySQL MultiMaster Replication

You may know about the MySQL Cluster, which is a complex architecture to achieve high availability and performance. One of the advantages of MySQL Cluster is that each node is a peer to the others, whereas in a normal replicating system you have a master and many slaves, and applications must be careful to write only to the master.

Share
Share

September 1, 2010
by Mohan Cheema
0 comments

How to get MySQL table Column Names without MetaData

Often we need to list just the column name of the table without displaying the metadata. However, Until before MySQL 5.0 there was no way to get just the column names for any given table. Since MySQL 5.0 new table has been added information_schema. INFORMATION_SCHEMA provides access to database metadata.

Share
Share

June 28, 2010
by Mohan Cheema
0 comments

Can’t open and lock privilege tables: Table ‘mysql.db’ doesn’t exist

Fatal error: Can’t open and lock privilege tables: Table ‘mysql.db’ doesn’t exist

I faced this problem while I was shifting the location of mysql data directory to non-default location. I copied all the files from /var/lib/mysql(default data location) to the /data and changed path in /etc/my.cnf also.

Share
Share

June 19, 2010
by Mohan Cheema
0 comments

Ping failed in MysqlValidConnectionChecker in JBoss/MySQL-ConnectorJ Combination

Today I was battling an issue for some of my colleagues. They were getting this exception from JBoss/Mysql ConnectorJ driver:

java.sql.SQLException: Unexpected error in ping : java.lang.IllegalArgumentException: object is not an instance of declaring class

in the JBoss console.

Share
Share

June 8, 2010
by Mohan Cheema
0 comments

Blobbing Data With PHP and MySQL


Blobbing Data With PHP and MySQL

Databases can be used for storing large amounts of binary data, known as BLOB’s. These BLOB’s can store just about any type of data imaginable, including MS Word documents, GIF/JPEG images, PDF files, MP3′s, etc. In this article we will see how to create a binary file repository using PHP and MySQL that can store and retrieve several different file types.

Share
Share

April 28, 2010
by Mohan Cheema
2 Comments

MySQL Database Replication HowTo

This tutorial describes how to set up database replication in MySQL. MySQL replication allows you to have an exact copy of a database from a master server on another server (slave), and all updates to the database on the master server are immediately replicated to the database on the slave server so that both databases are in sync. This is not a backup policy because an accidentally issued DELETE command will also be carried out on the slave; but replication can help protect against hardware failures though.

Share
Share

April 28, 2010
by Mohan Cheema
0 comments

Often Useful often forgotten unix commands

Here I have tried to list the commands that are useful for us (sys admins) but we still tend to forget. Listed here are a bunch of unix commands.

Share
Share