Hi John,

Personally, I'd just do a cut and paste job on the .sql file unless it
is too unmanageable.  Not knowing your platform, and being a unixy type
person, I would use sed or grep to strip out the lines that I need and
then plonk them straight into another file. I don't know how you could
accomplish that on a Windows platform.

I hope I haven't misunderstood, is the .sql file come from another MySQL
database or is this from a SQL server machine or similar? My
interpretation of a .sql file is something akin to that created by
mysqldump eg. a text file that has a number of SQL statements in it
allowing you to recreate the table by using this as input.

You can also use 

Regards

David Logan
Database Administrator
HP Managed Services
148 Frome Street,
Adelaide 5000
Australia

+61 8 8408 4273 - Work
+61 417 268 665 - Mobile
+61 8 8408 4259 - Fax


-----Original Message-----
From: John Mistler [mailto:[EMAIL PROTECTED] 
Sent: Monday, 12 December 2005 12:14 PM
To: mysql@lists.mysql.com; Logan, David (SST - Adelaide)
Subject: Re: Import Table?

Thanks for the response, David.  How about if I want to import all the 
entries from one specific TABLE within that sql file into a table with 
identical columns on my MySQL server?  Is there a way?

Thanks,

John

On Dec 11, 2005, at 5:29 PM, Logan, David (SST - Adelaide) wrote:

> Hi John,
>
> If it is a ".sql" file, with all appropriate SQL statements already in
> place then you only have to do the following
>
> $ mysql -u xxxx -p databasename <.sql file
>
> This will process all appropriate statements in the file.
>
> Regards
>
> David Logan
> Database Administrator
> HP Managed Services
> 148 Frome Street,
> Adelaide 5000
> Australia
>
> +61 8 8408 4273 - Work
> +61 417 268 665 - Mobile
> +61 8 8408 4259 - Fax
>
>
> -----Original Message-----
> From: John Mistler [mailto:[EMAIL PROTECTED]
> Sent: Monday, 12 December 2005 11:55 AM
> To: mysql@lists.mysql.com
> Subject: Import Table?
>
> Is there a command that will load in all of the data from a table
> within a database ".sql" file on disk?  The only import option I am
> seeing is "LOAD DATA INFILE" which requires a text file already
> exported to disk.  How about a way to load in the table data directly
> from the database file?
>
> Thanks,
>
> John
>
>
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    
> http://lists.mysql.com/[EMAIL PROTECTED]
>


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to