logo-mysql-heure-date

Convert timestamp to Date readable format in MySQL query

SQL query to convert timestamp to date readable format, which is stored in MySQL database.

SELECT t.*, DATE_FORMAT(FROM_UNIXTIME(t.enteredOn), ‘%e %b %Y’) AS formated_date FROM tbl_sample AS t;

For the detailed reference on DATE_FORMAT() and FROM_UNIXTIME()

Read More

Export all procedures alone from mysql via terminal

This is a easiest way to export all procedures alone from specified database through Terminal. Using mysqldump we can do this. General syntax of the command is as follows,

After enter the command in Terminal press ENTER, then the Terminal will prompt to enter database password where you have to provide the database password. Then you can check the path which you specified to save the .sql file. In the specified path you can see the export file.

Read More