[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sheflug] Access to MySQL



On Tue, 9 May 2000, Steve Tickle wrote:

> >If you have MySQL running, you will have in its installation bin directory a
> >program called mysql.  I don't know what the two export files are called,
> >but you can do something like:
> >
> >  $ mysql connection_parameters < first_file
> >  $ mysql connection_parameters < second file
> >
> >or
> >
> >  $ cat first_file second_file | mysql connection_parameters
> >
> >Where connection_parameters define the database (schema) that you
> >wish to populate, and first_ and second_file are the files from your
> >export script (and $ is the Linux prompt!)
> 
> The text files produced aren't just comma delimited data, they actually 
> contain the MySQL commands to create the db tables and SQL links and 
> queries. If they just contained the data then I could import them into 
> MySQL using the 'LOAD DATA INFILE' command having previously created the 
> db, but as they don't I'm a little confused.

The MySQL monitor is a small program designed to take SQL queries and
present them to the DB backend appropriately.  Normally you type these
commands in interactively, but it is possible to redirect standard input to
point to the files you want to stick into the DB.  That's what the previous
poster was showing you how to do.  The monitor will interpret all the
commands that are in the text file into commands for the backend, pass them
appropriately, the backend will do it's bit, and voila!  One complete
database.


-- 
-----------------------------------------------------------------------
#include <disclaimer.h>
Matthew Palmer
mjp16@uow.edu.au

---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word 
 "unsubscribe" in the body of the message. 

  GNU the choice of a complete generation.