At 3:20 PM -0800 1/15/01, Matt Thoene wrote:
>Hello,
>
>I've just installed and am running MySQL for a web site that was recently
>moved to this box.  The previous webmaster did a mysqldump of a database we
>need and it has a .sql extension.  I've read in the manual where you can
>import from a text file but can't seem to find how to import a .sql file.

Take a look at it.  If it contains SQL statements (likely), you don't
import it, you feed it to mysql to execute the statements.  For example:

mysql db_name < filename.sql

>Is it possible?  Also, is it possible to do an import of a database file
>without having to create the database first?  I hope so since I'm not
>familiar with what the layout was of this .sql when it was sent to me.

The .sql file probably has CREATE TABLE statements in it.  If so, you only
need to create an empty database and let mysql execute the contents of
the .sql file to create the tables for you.  Creating the database is
simply a matter of executing:

CREATE DATABASE db_name;

-- 
Paul DuBois, [EMAIL PROTECTED]

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to