Problem downloading .csv data to production server

The following code correctly loads the CSV file into MySQL on the WAMP Server, but it does not work on shared GoDaddy hosting:

<?php $con = new mysqli(DB_HOST,DB_USER,DB_PASS,DB_NAME); if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); }; $sql = "LOAD DATA INFILE 'Dis.csv' INTO TABLE `single-ecolo-dis-no-tbl` FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\n' IGNORE 1 LINES;"; 

I am not getting an error message, just a white page. I am sure all credentials are correct. There is no connection problem. It seems that the request is not running at all.

Edit: After enabling the error display, I get this error message after loading the page:

Failed to update user: access denied for user 'theUser' @ 'localhost' (using password: YES)

+4
source share
1 answer

Your username and / or password is incorrect for your MySQL database. Make sure you have the correct credentials, and then try again.

You can always ask for GoDaddy support if you don’t know where to get the correct credentials.

0
source

All Articles