Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2004-09-20
5
Medium Priority
?
1,510 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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
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

604 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