SQL Optimization Tips/Questions

Friday, December 4th, 2009

Below are some of the tips for SQL query optimizations in the form of question/answers.
1. Which of the following query is the most optimized?
a. SELECT column_name FROM table_name WHERE LOWER(column_name) = ‘name’.
b. SELECT column_name FROM table_name WHERE column_name = ‘NAME’ or column_name = ‘name’.
c. SELECT * FROM table_name WHERE LOWER(column_name) = ‘name’
d. SELECT * FROM table_name WHERE column_name = ‘NAME’ [...] Read more »

Connect mysql from Remote machine

Friday, February 13th, 2009

In mysql user need permission based on IP to connect mysql server. In default installation of mysql it doesn’t permit root to connect from remote machine
Using the following command, we set permission for connecting server from remote machines
shell> mysql –user=root mysql
mysql>GRANT ALL PRIVILEGES ON *.* TO monty@localhost IDENTIFIED BY ’some_pass’ WITH GRANT OPTION;
mysql> GRANT ALL [...] Read more »