Tuesday, 6 September 2016

MySQL Partitioning Example

This post is about partitioning a MySQL table by year by using range partition type. This post does not deal with the theories on partition, if you would like to understand the complete partitioning methods and types visit the official MySQL documentation. In this post we are directly focus on the implementation steps, assuming that we have knew the basics of MySQL partitioning types and its usages.


Tuesday, 24 May 2016

How to set up MySQL master - slave replication?

This post is about setting up Master- Slave replication on MySQL database. Here we assume that, primary master server is up and running and you need to add another server as a slave to an existing server. The following step by step guide will help you to set up the replication.

Tuesday, 19 April 2016

Understanding MySQL Architecture

The architecture of the world’s most popular open source database system is very important for the Information Technology people. There are many reasons for MySQL’s popularity around the world, but one of the main reasons is its architecture, while there are many big players such as Oracle, Microsoft SQL and DB2, MySQL’s architecture makes it as unique and preferred choice for most of the developers. In this article, we are going to discuss about of the internal architecture of the MySQL relational database management system. The article is for novice database administrators, database developers, software developers and those who are interested to work with MySQL database.

Sunday, 21 February 2016

[Solved] How to write a stored procedure in MySQL for insert?

Problem:

When multiple client applications such as web applications, desktop applications and mobile applications written in different languages like php, python, java, objective c, etc. need to perform the same database operation (insert), the same operations done by different client applications and client applications are directly accessing the database table using same SQL statement.

Solutions:

We are implementing stored procedure; here the client applications will simply call the defined stored procedures to perform the database operation (insert). In this post let us see about the syntax of the stored procedure and will see an example of insert operation using stored procedure using MySQL.

Friday, 22 January 2016

[Solved] How to solve MySQL error code: 1215 cannot add foreign key constraint?

Error Message:


Error Code: 1215. Cannot add foreign key constraint

Example:


Error Code: 1215. Cannot add foreign key constraint

 

Possible Reason:

Case 1: MySQL storage engine.

Thursday, 21 January 2016

[Solved] How to solve MySQL error code: 1062 duplicate entry?

Error Message:



Error Code: 1062. Duplicate entry ‘%s’ for key %d


Example:


Error Code: 1062. Duplicate entry ‘1’ for key ‘PRIMARY’

Possible Reason:


Case 1: Duplicate value.


The data you are trying to insert is already present in the column primary key. The primary key column is unique and it will not accept the duplicate entry.

Tuesday, 19 January 2016

How to write SQL query?

We have discussed about the conceptual data model, logical data model, normalization and denormalization techniques and we discussed about installing and running up with MySQL community server.  What will be next? Once we build the data model and decided the database server, the next process will be start developing the physical database. What is needed to develop physical database? We need a common language to communicate with both the developer and database server. Here, comes the structure query language. So in this post we are going to see about the SQL (Structure Query Language). After reading this post you will be able to answer the following questions: