Archive for the MySQL Category
mysql.sock path in Mac OS X
In my last post I discuss how to enable PHP over Apache in Mac OS X lion and today I bumped into a new problem. The problem is that when you install MySQL on Mac OS X and try to connect it via PHP, you will get an error. This error is thrown due to the fact that the path of the MySQL sockets are dif
Read Full PostHow to reset lost MySQL password
There are times when you get stuck with a lost password of MySQL database. And yes it becomes difficult to recall one with the computerized brains of ours :) In this post, I am going to show you how you can rest a lost MySQL password. Using this procedure you can reset the lost password of root o
Read Full PostMySQL: Increment an existing record in the table
This is a small tip which can help you optimize your MySQL query. Since you do not have to first “read” the record, instead you can increment it right there. I have seen some newbies doing the read and then increment process, which uselessly increases a select query to the database, each time yo
Read Full PostMySQL Optimization from a developer’s point of view
Undoubtedly a Web Application’s backbone is a database. Apparently, the Web Application’s performance is dependent on the database’s overall performance. However, some developers blame Database Administrators for non-performing of the web application to the end user. In fact, the role of de
Read Full PostDifference between InnoDB and MyISAM in MySQL
MyISAM and InnoDB are two most commonly used storage engines of MySQL database. However, MyISAM is the default storage engine chosen by MySQL database, when creating a new table. The major differences between these two storage engines are : InnoDB supports transactions which is not supported by
Read Full PostEnable query cache in MySQL to improve performance
There are lot many solutions to cache your database queries. Some use client level cache, some server side cache. However, MySQL itself provides a cache mechanism which is called “Query Cache” in which the queries being fired at the database are cached. Clearly saying, the result sets are cached
Read Full PostInstall MySQL Server 5 on Ubuntu and adding support to PHP
When you start web development MySQL is must have database. Since its free and is being used widely. Installing MySQL on Ubuntu is pretty easy and quick process. To install MySQL just run the following command. Open a terminal window and type the following command. sudo apt-get install mysql-se
Read Full PostMemory(heap) Storage engine in MySQL
Lately, I have been doing a lot of database stuff and during my odyssey I found lots of exciting stuff in MySQL. Memory storage in engine is one of those exciting stuff, which can be really useful at times, if used on right time at right place. Memory (heap) for the name itself signifies what I a
Read Full PostTransfer database from one host to other using mysqldump and shell
Transferring your blog or web site from one host to another can sometimes be very cumbersome if not troublesome. There may be instances when you get stuck at few points and one of the major loop hole is to transfer data from one host to another. Most of us use browser based user friendly phpmyadmin
Read Full PostDifference between truncate and delete in mysql
Well this is very common but much confused discussion. This question is often asked from freshers in interviews as well. The difference is pretty simple but yet people confuse it because they see the result to be the same of both the queries. Truncate and Delete are both SQL commands which result
Read Full PostInsert and update in single mysql query using on duplicate key
Hey Guys, Let me first explain you the scenario in which more likely you can use this type of query. A generic scenario would be that you are inserting data into a table and along with this you want to update a counter which is nothing but a field in the same table. More precisely or by taking
Read Full PostDelete duplicate entries/rows/values in mysql table in one query
Hi all, During my starting phase of career, i faced several challenging questions (being a fresher at that time). I wanted to share this one as simple as pie but can be difficult at times if you do not know how to do it. Question can be : How can you delete or remove duplicate entries from
Read Full Post