Tuesday, June 18, 2013

Import / Export MySQL Database using Ubuntu terminal

To import .sql file into MySQL database
mysql -u mysql_user -p dabase_name < /path/import_file_name.sql
It will ask for the password, enter the mysql password and your sql script will be executed.

To export a database and gzip it, use
mysqldump -h localhost -u mysql_user -pMysql_password database_name | gzip > /path/export_file_name_$(date +%m-%d-%Y).sql.gz
$(date +%m-%d-%Y) is optional. It inserts today's date in the file name. You can also use this export command without   $(date +%m-%d-%Y)

 mysqldump -h localhost -u mysql_user -pMysql_password database_name | gzip > /path/export_file_name_$(date +%m-%d-%Y).sql.gz

I hope it helped. Feel free to comment...

Friday, June 7, 2013

check memory ubuntu terminal

 egrep --color 'Mem|Cache|Swap' /proc/meminfo

I hope it helped. Feel free to comment...

Thursday, June 6, 2013

Extract sql.gz file from ubuntu terminal


 gzip -d file.sql.gz

I hope it helped. Feel free to comment...

Tuesday, June 4, 2013

Linux useful 20 tools

http://www.cyberciti.biz/tips/top-linux-monitoring-tools.html

I hope it helped. Feel free to comment...