For Programmers: Free Programming Magazines  


Home > Archive > PHP SQL > April 2006 > How to import table structure?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to import table structure?
Dave

2006-04-06, 6:59 pm

Greetings

I am doing a job to migrate an informix database server to mySQL DB. There
are 20 12 database which contains 300 tables.

I have made table data move working by using LOAD series SQL commands. But
it is very slow to copy table structure. Rightnow I create table one by
using (CREATE TABLE ......... ).

Is there any smart way of importing table structure?

Thanks


NC

2006-04-07, 6:59 pm

Dave wrote:
>
> I am doing a job to migrate an informix database server to mySQL DB. There
> are 20 12 database which contains 300 tables.
>
> I have made table data move working by using LOAD series SQL commands.
> But it is very slow to copy table structure. Rightnow I create table one by
> using (CREATE TABLE ......... ).
>
> Is there any smart way of importing table structure?


Sure. Put all your CREATE TABLE queries into one text file (let's call
it q.txt) and run the following command line:

mysql -u [username] -p[password] [db_name] < q.txt

Note that there is no whitespace between -p and the password...

Cheers,
NC

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com