Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mysqldump

Status
Not open for further replies.

chz013

Programmer
Jan 5, 2003
73
US
Hi
In mysql, I create a database with a statement; I already have database named two
mysql> create database one;

Outside of mysql, I type
->mysqldump --opt two > backup-two.sql
->mysqldump one < backup-two.sql

-- MySQL dump 8.21
--
-- Host: localhost Database: one
---------------------------------------------------------
-- Server version 3.23.49-log


When I went into mysql to query,
mysql> select DATE from abc;
ERROR 1146: Table 'one.abc' doesn't exist


Must I create tables from scratch outside of
backup-two.sql ?

I thought backup-two.sql already contains structure
to create tables in database one.

What did I do wrong ?

Any help is appreciated.
 
Mysqldump only exports into .sql file

To import the dump file
the second command should simply be


mysql --options one < backup-two.sql


Bye

Qatqat

I have been happy throughout my life in thinking that samba was I kind of dance; now I live with Linux and all I do is working.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top