Board index   FAQ   Search  
Register  Login
Board index php forum :: Database MySQL Installation

programmatically run a sql file

Installation and configuration iussues

Moderators: macek, egami, gesf

programmatically run a sql file

Postby lostboy » Thu Jun 03, 2004 7:00 am

Hi Guys,

I am working on creating an install package for an application (uses Apache, MySQL, PHP). I have the table structures in a install.sql file that I need to run to create the base tables for the application.

The installer is a VB exe.

Can any one tell me how to include the install.sql file to create the base tables? As well, I need to run a sql to create new user accounts and drop the basic default accounts that come with the MySQL install.

Should I be using PHP to do this? I could work this out, but I know I can run the SQL files. I just need a pointer or two on how to do this.

TIA

:eek:
lostboy
New php-forum User
New php-forum User
 
Posts: 10
Joined: Thu Jun 03, 2004 6:41 am
Location: Toronto, Canada

Postby ruturajv » Thu Jun 03, 2004 7:44 pm

mysql has a command line syntax utilty as "source" which uses the a file and executes the content in it on the mysql,
User avatar
ruturajv
php-forum Super User
php-forum Super User
 
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India

Postby lostboy » Fri Jun 04, 2004 3:37 am

example or link to manual ?
lostboy
New php-forum User
New php-forum User
 
Posts: 10
Joined: Thu Jun 03, 2004 6:41 am
Location: Toronto, Canada

Postby gesf » Fri Jun 04, 2004 8:04 am

Here you have: MySQL LOAD DATA INFILE!
User avatar
gesf
Moderator
Moderator
 
Posts: 1718
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden


Return to MySQL Installation

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.