PowWeb Forums - The Perfect Community for the Perfect Host  

Register now to interact with over 11,000 members! Registered users have Posting Privileges, free access to Private Messaging, Email Notifications and more.

Go Back   PowWeb Community Forums > The PowWeb Platform > MySQL
User Name
Register FAQ Members List Search Today's Posts Mark Forums Read

Closed Thread
Thread Tools
Old 4-10-05, 08:53 PM   #1
Join Date: Jun 2004
Location: Perth, Western Australia
Posts: 22
Reputation: 5
Question Execute sql script from command line to create tables.

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

$ 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.
icook is offline  
Old 4-10-05, 09:13 PM   #2
Perplexed Person
Gorkfu's Avatar
Join Date: Jan 2005
Location: Pacifica, CA
Posts: 328
Reputation: 33
You can do this in phpmyadmin.

1. Select your database on left.
2. Hit SQL tab at top.
3. Copy and paste the sql query you have into the box and hit go.

Also can upload SQL files to add to your DB.

It should go through flawlessly.

Confusion is bliss

Did I mention my brain hurts?

phpCheckZ - The RSWR Network - UPC Food Search - The Organic Food Database
Gorkfu is offline  
Old 4-11-05, 01:18 AM   #3
Join Date: Jun 2004
Location: Perth, Western Australia
Posts: 22
Reputation: 5
That worked very well.
Thanks for the advice!!!!

icook is offline  
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT -4. The time now is 06:59 AM.

Contents ©PowWeb, Inc. ~ vBulletin, Copyright 2000-2007 Jelsoft Enterprises Limited.