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:

Friday, 15 January 2016

How to install MySQL server on windows?

Last week I got an assignment where I need to install MySQL server on client’s machine, after checking the system requirements, I came to know that, the machine contains the 64 bit windows operating system. So I thought to download MySQL community server for windows 64 bit operating system, but I found that the website provides only 32 bit installer for windows, and for 64 bit operating system, the website provides the zip file for download. My client needs to manage the MySQL products by himself; he was expecting software where he can manage all MySQL products at one place, so we need MySQL installer in that machine. So I decided to install MySQL server on windows machine using MySQL installer web community. In this post, let me go through the step by step guide to install MySQL server on windows machine.