Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 25th, 2007, 1:10 AM   #1
paulchwd
Hobbyist Programmer
 
paulchwd's Avatar
 
Join Date: Mar 2005
Posts: 139
Rep Power: 4 paulchwd is on a distinguished road
Question How do i run a script in MySql

Hi All,

I have a .SQL file with all my create table statements and another with my indexes and another with my insert into statements

I created a database (create database test) sucessfuly, but how do i run a script on that database

Also where do my scripts have to be (The /MySql/My SQL 5.0/scripts directory ?)

many thanks
paulchwd is offline   Reply With Quote
Old Feb 25th, 2007, 1:19 AM   #2
PhilBon
Hobbyist Programmer
 
PhilBon's Avatar
 
Join Date: Nov 2005
Posts: 172
Rep Power: 3 PhilBon is on a distinguished road
Send a message via AIM to PhilBon Send a message via MSN to PhilBon
What you do is go to command line and run the script from there, i'm not sure if you can just go c:\script.sql or if you have to copy and paste it in. One of the two ways should work.
PhilBon is offline   Reply With Quote
Old Feb 25th, 2007, 3:09 AM   #3
paulchwd
Hobbyist Programmer
 
paulchwd's Avatar
 
Join Date: Mar 2005
Posts: 139
Rep Power: 4 paulchwd is on a distinguished road
if this helps to explain what im getting at:

With oracle you have your .SQL file that contains lets say create table statements, and at the command line you type @ followed by the file name and it runs the statements in the file.

in mysql what is the syntax for doing this
paulchwd is offline   Reply With Quote
Old Feb 25th, 2007, 3:21 AM   #4
xavier
Professional Programmer
 
xavier's Avatar
 
Join Date: Oct 2004
Location: .ro
Posts: 383
Rep Power: 4 xavier is on a distinguished road
Send a message via Yahoo to xavier
http://dev.mysql.com/doc/refman/5.0/...-commands.html
Maybe this will help
__________________
Don't take life too seriously, it's not permanent !
xavier is offline   Reply With Quote
Old Feb 25th, 2007, 10:52 AM   #5
paulchwd
Hobbyist Programmer
 
paulchwd's Avatar
 
Join Date: Mar 2005
Posts: 139
Rep Power: 4 paulchwd is on a distinguished road
Question

source C:\........
works perfectly, .. thanks

my next question is: is there a programming language I can use to write programs in MySql -- like PL/SQL in Oracle

where you make programs that run at the command line of MySql ??

Many Thanks and happy programming to all of you
paulchwd is offline   Reply With Quote
Old Feb 26th, 2007, 6:31 AM   #6
pegasus001
Hobbyist Programmer
 
pegasus001's Avatar
 
Join Date: Nov 2006
Location: 163H
Posts: 213
Rep Power: 2 pegasus001 is on a distinguished road
Here u can find some interesting tools that can come very handy and helpful. Also about languages to program to anything does. You only need the ODBC drivers of MySql and say welcome to .NET. I have tried the headers provided with MySql in visual studio 2003 but it seemed to have some errors and nothing worked. So now i am downloading here.

Good luck.
__________________
You never test the depth of a river with both feet.
The believer is happy. The doubter is wise.
Free speech carries with it some freedom to listen.
The next generation will always surpass the previous one. It`s one of the never ending cycles of life.
pegasus001 is offline   Reply With Quote
Old Feb 26th, 2007, 3:49 PM   #7
paulchwd
Hobbyist Programmer
 
paulchwd's Avatar
 
Join Date: Mar 2005
Posts: 139
Rep Power: 4 paulchwd is on a distinguished road
Thanks. I will look into this.

Also, it would be very helpfull if you could take a look at my other post (Mysql error) its in this same room thanks
paulchwd is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tutorial - Using MySQL in C# Darkhack C# 12 Jan 17th, 2006 9:28 AM
Simple Perl / MySQL Problem.. pls help! domquemo Perl 0 Jan 11th, 2006 4:08 AM
A simple perl script satimis Perl 3 Aug 15th, 2005 9:31 AM
Bash Script Help pelon Bash / Shell Scripting 2 Feb 28th, 2005 3:58 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:21 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC