Wednesday, December 28, 2011

Mysql Date Operation

1. Mysql Get first day of next month

SELECT (DATE_FORMAT(current_date ,'%Y-%m-01')) + interval 1 month;

2. Mysql Get first day of last month

SELECT (DATE_FORMAT(current_date ,'%Y-%m-01')) - interval 1 month;


Centos 7 reset root/ any user lost password / lockout due to cant remember password

1. Need to be in front of the terminal. (Physically if not vm). 2. Reboot the server 3. Press 'e' in the GRUB2 boot screen. 3. bunch...