How to import text file into database?

This is using mysql in a CentOS server. A database named AA is created. My development passed me a text file (.txt) and want me to import into this AA database, how should I do it? This is using for a wordpress web site, and numeral tables, such as, wp-commentmeta, wp-comment, wp-links, wp-options are there.

Please show step-by-step. Thanks first.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ray PaseurCommented:
If you're new to PHP and MySQL, this article can help you get the foundation you need.

In order to help with this, we would need to see the columns in the data base tables and the data in the text file.  As far as i know there is no "one-size-fits-all" method of importing text into a data base table, since there can be any number of data elements in either.

If you can post the CREATE TABLE statement for the tables in the AA database, along with a bit of the test data from your text file, we may be able to help you get started.  Or we may advise you to be respectful of your time and just hire an experienced programmer.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MichaelBalackAuthor Commented:
Hi Ray,

Thanks for your advice.

This AA is a new web site built on Wordpress. Maybe I go through the setup process down here. At first, apache web server is setup, follow by mysql & php, both with version 5.x. After that, I move this AA folder (created by my web vendor), to /var/www/html; Please see the folder list (of AA) as follows:

     -- cgi-bin (folder)
     -- wp-admin (folder)
    -- wp-contents (folder)
    -- wp-includes (folder)
    wp-admin.php, index.php

Open the wp-admin.php, and change the DB_User, DB_password, DB_host, etc correctly; Database name is AK. Use
MySQL command, type "mysql -u root -e create database AA"; to create AA DB.

In MySQL, after "use AA", and then type "show tables" with list of tables in display as follows:


I also setup the adminer in Wordpress. When I tried to import the txt file (2.3 Mb), the following oversize error occurs:

Please see the attached adminer_error1

MichaelBalackAuthor Commented:
As Ray suggested, I don't even know how to conduct the commands as stated, I have outsource the whole tasks to a web-hosted provider.
Ray PaseurCommented:
I think outsourcing this is a very good idea!  Thanks for the points, ~Ray
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.