Archive for the ‘ MySql ’ Category

VIF: Very Important Functions

Comparison Functions and Operators:

IS NULL, IS NOT NULL

MySql Manual

Control Flow Functions:

SELECT IF(1>2,2,3); -> 3
SELECT IFNULL(NULL,10);  -> 10

MySql Manual

TIMESTAMP Properties:

HOUR(this.date)
SECOND(this.date)

MySql Manual

Date and Time Functions:

DAYOFWEEK(this.date)
DAYOFMONTH(this.date)
DAYOFYEAR(this.date)

MySql Manual

Logon mysql root + password

Connect with password:

mysql -uadmin -p

Change password to OLD hash:

SET PASSWORD FOR 'root'@'localhost' = OLD_PASSWORD('truc')