Jump to content

[SOLVED] Importing text files into database for MySQL 5.0


twilitegxa

Recommended Posts

How do I need to set up the records in the text file in order to import the records into my MySQL database? I am using MySQL 5.0.51b and I currently have a text file saved with each field separated by a comma and this was able to be imported by Microsoft Access in this format, but is not accepted by MySQL. What format do I need to put my records in for the text file to be imported into the MySQL database? I am running a program call WampServer, if that helps.

Link to comment
Share on other sites

I tried changing the extention, but I still recived an error about the syntax. I have each field like: 

 

"field1","field2","field3"....and so on.

 

Is this right? Maybe the character set is wrong for some reason? When I import, it is set to utf8. I tried saving it with the same character set, but it's still not working. This is the error I receive:

 

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"Sailor Moon","Serena Tsukino","Purity And The Soul","13","06","30","1978","4","' at line 1

Link to comment
Share on other sites

I'm not using a query. It's kind of a built-in feature of the program I'm using. It has an import option. The program is WampServer. I didn't know I could use a query to do it. Can anyone help e out with how to do the query? It might be easier that way possibly. I am still very new to MySQL and PHP.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.