Solved

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

Posted on 2004-09-20
5
1,426 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 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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
Creating and Managing Databases with phpMyAdmin in cPanel.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

696 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