Loading a query from a text file in MySQl

liunx

Guest
Hi there,

I've just started using MySQL after having used SQL and SQL+ and I had a quick question.

I have some MySQL scripts that I want to re-use and I was wondering how I would go about saving the query scripts from, say, Notepad and then loading them onto MySQL.

Can anyone tell me?

Thanks,

SimonAs far as what to save the file with, notepad is just fine and dandy.

As far as how to execute the file into mySQL, are you talking programmatically or manually?I'd like to run the query manually. Basically, I have some scripts to create tables within a MySQL database and I'd like to create them now on my test server and then be able to run the same one again when I upload it onto my production webserver.

I run MySQL through the command window at present.

Thanks,

<!-- m --><a class="postlink" href="Simonhttp://www.mysql.com/doc/en/Backup.html">Simonhttp://www.mysql.com/doc/en/Backup.html</a><!-- m -->

you should also get a program called PhpMyAdmin (<!-- m --><a class="postlink" href="http://www.phpmyadmin.net">http://www.phpmyadmin.net</a><!-- m -->)

that will allow you to do all kinds of stuff without using the command prompt.
 
Top