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
Password
Register FAQ Members List Search Today's Posts Mark Forums Read

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

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

Quote:
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.
icook is offline  
Old 4-10-05, 08:13 PM   #2
Gorkfu
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.


Ryan
__________________
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, 12:18 AM   #3
icook
Registered
 
Join Date: Jun 2004
Location: Perth, Western Australia
Posts: 22
Reputation: 5
Excellent!
That worked very well.
Thanks for the advice!!!!

Ian
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 05:04 AM.


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