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....

No comments:

Post a Comment