This has been a nightly job working for two years. PHP file imports a txt file into MYSQL database. Suddenly today getting Malformed Packet when importing a TXT file. I noticed the server has only been up 23 hours, so I think GoDaddy could have updated something.
MYSQL Ver = 5.6.43-cll-lve
local_infile = ON
Without "local" I get error, "Access denied for user", I've tried granting FILE but having issues getting mysql CLI access via SSH (never needed it before) and PHP MY Admin doesn't have access rights.
I've spent an entire day on this, and can't figure out what to do. I have tried setting the file to 777 as well.
I've tried removing the truncate part and just doing the import, culling the import file down to 3 lines, using old import files that worked before-- can't make heads or tails.
require('config_dev.php');
$path = '/home/pro/public_html/upload/IDUpload_dev.txt';
$mysqli = new mysqli($hostname,$username, $password, $dbname);
if ($mysqli->connect_error) {
die('Error : ('. $mysqli->connect_errno .') '. $mysqli->connect_error);
}
$sql1 = "TRUNCATE TABLE Accounts;";
if (!$mysqli->query($sql1)) {
echo "\nQuery execute failed: ERRNO: (" . $mysqli->errno . ") " . $mysqli->error;
} else {
echo ("Truncated<br>");
}
$sql2 = "LOAD DATA LOCAL INFILE '".$path."' INTO TABLE Accounts
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
IGNORE 1 LINES
(acct,type,zip)";
if (!$mysqli->query($sql2)) {
echo "\nQuery execute failed: ERRNO: (" . $mysqli->errno . ") " . $mysqli->error;
} else {
echo ("Imported.");
}
mysqli_close($mysqli);