Tuesday, December 2, 2014

Mysql: execute sql file from command line.

If you need to execute some commands from command line,as in this case, all stored into a .sql file give this:

> mysql -u _your_username_ -p

after inserted the password

> use _your_database_ ;

(in case of your_database is not existent remember to create it before. )
then

> source /home/_your_userhome_/_your_file.sql


Bye....

Mysql: quick backup with mysqldump

You need to do a quick backup of a mysql table?
Give this command:

mysqldump database_to_backup_name -u root -p > ./filename_with_dumped_db.sql

this will produce a file(filename_with_dumped_db.sql) with all the backupped db(database_to_backup_name).

Please refer here to the mysql manual pages.

Bye..

Monday, December 1, 2014

linux: make a symbolic link to a directory

From command line this give you a link to a folder:

ln -s /home/user/workspace/original_folder_to_link/ /var/www/linked_folder

Bye...