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, I need to use different [...]

Show Current Database in MySQL

Oct 13th, 2009

Know which database is in effect! All Queries are executing against which database?

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 host name.

3. >grant all privileges on *.* to [...]

MySQL: Remove Duplicate Rows/Records from Table

Jun 22nd, 2008

methods for deleting duplicate rows/records from a table in mysql. The same concept should work in other databases for example, Oracle, as well.

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.
You may find utf8_general_ci and utf8_unicode_ci suitable as [...]

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 current user’s password only.
Or

mysql> Set password for [...]

PHP Login and Logout Script

May 6th, 2007

Login and Logout script written in PHP and Mysql. A simple script, ready to modify, use referrer to send to landing page after login. A special target functionality also works when suppose in case user is admin.