[lug] mysql table creation scripts

John Starkey jstarkey at advancecreations.com
Sun Jun 10 23:22:12 MDT 2001


> > Create the script and do:
> >
> > mysql -u root -p < script_file
> >
> > It will prompt you for the password and then do the deed.
> >
> > script_file should contain just the
> >
> > create table whatever (
> > field1 text,
> > RecordID int not null auto_increment,
> > primary key( id ));
> >
> > You get the pic.
>
> This is *very* close to what I need. The one problem remaining is that
> the mysqldump does not specify which db a given table belongs to; e.g.,
> it might say a table name as "tablename", but if it belongs to a db
> called "dbname", it fails to dump as "dbname.tablename". And the mysql
> command does not offer a command line means to specify which db to use
> on the command line. So I must still manually edit all the mysqldump
> scripts to explicitly use the syntax "dbname.tablename" instead of just
> "tablename".

mysql database_name -u root -p < script_file

Should put it in the correct DB. Sorry.

John




More information about the LUG mailing list