Solved

mysqlimport: Error: Table 'database.table' doesn't exist, when using table: table

Posted on 2004-09-20
5
1,358 Views
Last Modified: 2008-12-09
Hi There,
I was wondering if someone could help me with the syntax to import a .dmp file into my mysql db? I am using the version of mysql 4.0.20ant.

I use the syntax below:
mysqlimport --no-defaults -u root -p mydb mfile.dmp

and I get the error:
mysqlimport: Error: Table 'database.table' doesn't exist, when using table: table

Sean - thanks in advance
0
Comment
Question by:bullrout
  • 2
  • 2
5 Comments
 
LVL 26

Expert Comment

by:ushastry
ID: 12109692
Hi,

is there any tables named "mfile" in the mydb database..?
coz For each text file named on the command line, mysqlimport strips any extension from the filename and uses the result to determine the name of the table into which to import the file's contents. For example, files named `patient.txt', `patient.text', and `patient' all would be imported into a table named patient.

Check out here for more..

http://dev.mysql.com/doc/mysql/en/mysqlimport.html

you can also use Load DATA for the same..

http://dev.mysql.com/doc/mysql/en/LOAD_DATA.html
0
 
LVL 5

Author Comment

by:bullrout
ID: 12109926
Hi there,

so for each table named in the .dmp file I need to specfiy all of them when I import the data? or is there a switch that will enable me to import the whole file without knowing the data structure?

sean
0
 
LVL 26

Accepted Solution

by:
ushastry earned 500 total points
ID: 12110103
can you tell me, is this myfile.dmp is genarated from mysqldump/phpmyadmin? or just text file that contains data's(comma separated/tab delimited)..

if it is generated from mysqldump..

then just issue this command..

mysql  -uusername -p mydb < mfile.dmp
0
 
LVL 5

Author Comment

by:bullrout
ID: 12110243
ushastry, you are a legend, I used the syntax "mysql  -uusername -p mydb < mfile.dmp" and it seems to be working!!!

Thanks very much!

Sean
0
 

Expert Comment

by:BruceKA9
ID: 13205492
This did not work for me.  I am trying to copy a MySQL UNIX database to a XP machine.

I have a phpAdmin MySQL-Dump Ver 2.3.1 dump of all my tables in one database.  The text output contains the CREATE TABLE statements for all the tables and the INSERT INTO statements for the table data. The beginning of the SQL comment lines have the # character, generated by phpAdmin.  The host machime Server Version is 3.23.44 and the PHP Version is 4.2.2. This data comes from a UNIX file server running my website.

I wanted to put this database on to a WIN/XP machine to do some additional PHP testing.  The XP machine is current with M/S Update.  The phpAdmin MySQL Dump Ver is 2.6.1, the MySQL Version is 4.0.23 and the PHP Version is 4.3.10.

All the MySQL privages have been granted to localhost.  The MySQL, Apache and PHPAdmin are running with all the defaults.

When I use CMD and type this command

>MySQL -uusername -ppassword mydb <mfile.sql

nothing happens, just a carridge return and >.  
When I use CMD and type is command

>MySQLImport -uusername -ppassword mydb <mfile.sql

or

>MySQLImport -uusername -ppassword -l mydb mfile.sql

I get the "mysqlimport: Error: Table 'database.table' doesn't exist, when using table: table" error.

So what else can I try?





0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Loading csv or delimited data files to MySQL database is a very common task frequently questioned about and almost every time LOAD DATA INFILE comes to the rescue. Here we will try to understand some of the very common scenarios for loading data …
Foreword This is an old article.  Instead of using the MySQL extension that was used in the original code examples, please choose one of the currently supported database extensions instead.  More information is available here: MySQLi / PDO (http://…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now