PDA

View Full Version : how to run a sql script from remote ?


ytschachtli
16-07-04, 01:18 AM
Hi,
My server is hosted. How do you run this kind of script :

#mysql -udotproject -pyourpassword dotproject < dotproject/db/dotproject_{version}.sql*

from your local PC ?

Thanks for your help.
Yves

cyberhorse
16-07-04, 03:06 AM
As long as you have mysql in your path, you run it from any kind of command shell, regardless of the OS. You have to create the dotproject database first, and you have to be in the directory of where you installed dotproject. Then you just run `mysql -u [db_user] -p dotproject < db/dotproject.sql` which will ask you for the password for the db_user you selected and will then create all the necessary folders for dp to run. In the latest CVS, there is an install script, which creates the db for you I believe.

ajdonnison
16-07-04, 08:40 AM
If your host allows remote access you would add the -h host option to your mysql line, or better still, most hosting companies provide a web-based interface to the database (usually phpMyAdmin) and that makes it much easier to use. Just use the SQL upload facility on phpMyAdmin.