Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7432123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:24:25+00:00 2026-05-29T09:24:25+00:00

I have csv file exported from access. (dates formatted to match mysql) I need

  • 0

I have csv file exported from access. (dates formatted to match mysql)

I need to import the data into a mysql DB through code.

when I import the file through PhpMyAdmin it worked beautifully.

$fname = $_FILES['sel_file']['name'];
$filename = $_FILES['sel_file']['tmp_name'];
$sql="LOAD DATA INFILE '../filepath/data.txt' INTO TABLE table1 FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"';";
 mysql_query($sql)or die(mysql_error());

I tried using the file path or using the variable $filename and both gave me the same error

I get the following error:

Access denied for user ‘uname’@’%’ (using password: YES)
I set the permissions to be 777, The databse was created allowing direct access. (I am able to opload the file and read from it using an “INSERT” statement, but not load data.)

A. Is the LOAD DATA statement wrong?

B. What other things do I have to take care of in order to use the LOAD DATA command.

Thank you all!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:24:26+00:00Added an answer on May 29, 2026 at 9:24 am

    Try LOAD DATA LOCAL INFILE

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have exported a CSV file from a database. Certain fields are longer text
I have a csv file uploaded and data read into an array .The valid
I have csv file having some address data mostly in Finnish language. I need
I'm working with a CSV file which is exported from Excel. I have a
I have two .csv files containing correlation matrices exported from R. One file contains
How to read and import .csv file in groovy on grails. I have .csv
I have CSV file with sample data in this form : 220 30 255
I have a CSV file with mappings from project ids to some new category
I have a csv file with following sample data. o-option(alphabetical) v-value(numerical) number1,o1,v1,o2,v2,o3,v3,o4,v4,o5,v5,o6,v6 number2,o1,v11,o2,v22,o3,v33,o44,v44,o5,v55,o6,v66 and
I have CSV data loaded into a multidimensional array. In this way each row

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.