Posts

Capitalize first letter in SQL

concat(ucase(left( column_name , 1)), substring( column_name , 2))

Set auto increment value in MySQL

ALTER TABLE table_name AUTO_INCREMENT = value ;

Check free disk space in Linux

df -h df -h /path/to/dir

Checking disk space usage

du - kscx *

Start/Stop MySQL Server on CentOS

Stop MySQL Server # /etc/init.d/mysqld stop Start MySQL Server # /etc/init.d/mysqld start Restart MySQL Server # /etc/init.d/mysqld restart

Apcahe configuration file location in CentOS

Get the path of running Apache: ps -ef | grep apache Append -V argument to the path Configuration file is SERVER_CONFIG_FILE under HTTPD_ROOT directory

Show column names in alphabetical order

SELECT c . column_name FROM INFORMATION_SCHEMA . COLUMNS c WHERE c . table_name = 'tbl_name' -- AND c.table_schema = 'db_name' ORDER BY c . column_name