Hi all;
I am trying to create a database using a dump file, but am not too sure how to do it.
1)I know/think that this is the command I have to use :
mysql> mysql -u <username> -p <password> -D <database> < news.sql
but it doesn't seem to work and just spits out errors.
2)where do i put my news.sql file
thanks
creating database using dump file
Moderator: General Moderators
-
sunderwind
- Forum Newbie
- Posts: 9
- Joined: Thu Aug 29, 2002 4:24 am
- Location: Irving, TX
- Contact:
I would guess that the dump file does not contain the create database <database> (You have to provide a special switch when making the dumpfile to get this)
Create the database first. Either log into mysql and "create database <DB>" or use "echo 'create database <DB> | mysql -u <username> -p <password>" or use "mysqladmin -u <username> -p <password> create <DB>"
If you already have a database named the same and it contains data, you will probably need to drop it, recreate it, and then load the dump.
After you have created the database do what you tried before.
Create the database first. Either log into mysql and "create database <DB>" or use "echo 'create database <DB> | mysql -u <username> -p <password>" or use "mysqladmin -u <username> -p <password> create <DB>"
If you already have a database named the same and it contains data, you will probably need to drop it, recreate it, and then load the dump.
After you have created the database do what you tried before.