icook
4-10-05, 08:53 PM
Hi,
Can someone pelase tell me how to execute a sql script from the command line.
I am trying to set up phpESP and it says for me to run a script called mysql_populate.sql from the command line. As there are about 16 tables I figure it would easier (and safer) to run the script that to create the tables manually.
I am new to this so please any advice would be appreciated.
Below is an extract from the install manual.
Thanks in advance.
Ian Cook :)
b. Tables and Data
Once a database and user have been created for phpESP, you must
create and populate the tables for phpESP. You will find a
script names "mysql_populate.sql" in the same location as the
last script. This script should be executed on the new phpESP
database as the root user in mysql. As above, you may run this
script using an administration tool of your choosing.
Note: The recommended and supported method of executing these
scripts is via the mysql CLI (command line interface). For
example, to run these scripts you would execute the following
commands:
$ mysql -u root -p < scripts/db/mysql_create.sql
$ mysql -u root -p phpesp < scripts/db/mysql_populate.sql
If you use a database name other than "phpesp", substitute
that name on the second command line.
Can someone pelase tell me how to execute a sql script from the command line.
I am trying to set up phpESP and it says for me to run a script called mysql_populate.sql from the command line. As there are about 16 tables I figure it would easier (and safer) to run the script that to create the tables manually.
I am new to this so please any advice would be appreciated.
Below is an extract from the install manual.
Thanks in advance.
Ian Cook :)
b. Tables and Data
Once a database and user have been created for phpESP, you must
create and populate the tables for phpESP. You will find a
script names "mysql_populate.sql" in the same location as the
last script. This script should be executed on the new phpESP
database as the root user in mysql. As above, you may run this
script using an administration tool of your choosing.
Note: The recommended and supported method of executing these
scripts is via the mysql CLI (command line interface). For
example, to run these scripts you would execute the following
commands:
$ mysql -u root -p < scripts/db/mysql_create.sql
$ mysql -u root -p phpesp < scripts/db/mysql_populate.sql
If you use a database name other than "phpesp", substitute
that name on the second command line.