?
Solved

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

Posted on 2004-09-20
5
Medium Priority
?
1,460 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 26

Expert Comment

by:Umesh
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:
Umesh earned 2000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

800 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