Archive

Posts Tagged ‘MySQL’

MySQL SELECT statement where something exists in List

Dec 25th, 2009

Just recently I am back in development from support and development. So, I need to refresh my memory. Many times I have used implode() for checking whether something is in list or not using – Select … where in list. This time list items was string and not numbers. So,… READ MORE

Show Current Database in MySQL

Oct 13th, 2009

How to know which database is in use currently? For using a particular database, MySQL has <code>Use </code> statement. After you execute USE statement, by default all the query will be executed against the database mentioned in USE statement.

Use database_name;

For using other database after this statement, you can… READ MORE

Common But Important Mysql Commands And Queries

Oct 21st, 2008

Here are some of the generally used queries. These are important and useful.

1. >mysql –user=root mysql

default user name is “root”. And there is no password.

2. >grant all privileges on *.* to ’sat@localhost’ identified by ’satpwd’ with grant option;

’sat’@'localhost’ -> sat is username and localhost is mysql… READ MORE

MySQL: Remove Duplicate Rows/Records from Table

Jun 22nd, 2008

How to remove duplicate entries from a table? Here are few methods for deleting duplicate rows/records from a table in mysql. The same concept will work in other database table for example, Oracle, as well.
Methods of deleting duplicate records in a table:-
1. Alter table for adding unique index… READ MORE

International Languages And Character Set Required In Mysql

Jun 8th, 2008

For international languages support utf8 is required in mysql column/field. MySQL allows to set  different character set on each different columns.
MySQL 5.0 supports two Unicode character sets: UCS2 and all familiar “utf8″.
Each Unicode character set has similar collations available to exactly suit many languages like ucs2_persian_ci and utf8_persian_ci.… READ MORE

Client Does Not Support Authentication Protocol

Aug 31st, 2007

Are you surprised why your mysql user-password is not working after upgradation to newer version of mysql server. Yes, It will not allow you to login in mysql server this way. Answer is simple: Just change your mysql password using old_password() function.

mysql> Set password = old_password(‘password’);

This will change… READ MORE

PHP Login and Logout Script

May 6th, 2007

This is very simple Login and Logout Script. It is a simple script so that you can understand the logic and modify the script easily. No script can fulfill all your requirements in working condition so it is a small and simple script for you to modify.
It has referrer… READ MORE