Solved

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

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
setup wamp server for first time 2 83
Complex SQL statement in VB.NET 7 31
Help With Simple Database Design 7 50
Formating field inside mysql query 2 15
More Fun with XML and MySQL – Parsing Delimited String with a Single SQL Statement Are you ready for another of my SQL tidbits?  Hopefully so, as in this adventure, I will be covering a topic that comes up a lot which is parsing a comma (or other…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

830 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