Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Other Web Development Languages (http://www.programmingforums.org/forum40.html)
-   -   How do i run a script in MySql (http://www.programmingforums.org/showthread.php?t=12660)

paulchwd Feb 25th, 2007 2:10 AM

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

PhilBon Feb 25th, 2007 2:19 AM

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.

paulchwd Feb 25th, 2007 4:09 AM

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

xavier Feb 25th, 2007 4:21 AM

http://dev.mysql.com/doc/refman/5.0/...-commands.html
Maybe this will help :)

paulchwd Feb 25th, 2007 11:52 AM

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

pegasus001 Feb 26th, 2007 7:31 AM

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.

paulchwd Feb 26th, 2007 4:49 PM

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


All times are GMT -5. The time now is 1:46 AM.

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