Hello,
My ISP has my sql running on a dedicated mysql server and I am having problems loading a text file into my database table using the code below to execute the upload:
$sh = mysql_connect("mysql.domain.com","MysqlName","$MysqlPW");
$dbc = mysql_select_db("$dbName",$sh);
$sql = "LOAD DATA INFILE 'http://www.domain.com/admin/dbupload.txt' REPLACE INTO TABLE books FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r\n'";
$result = mysql_query($sql,$sh);
if ($result){
ECHO "DATA Loaded: $sql";
}else{
ECHO mysql_error();
}
I get the following error when I execute:
Access denied for user: 'username@lsh135.siteprotect.com' (Using password: YES)
I have contacted my host and this is the information they sent back concerning the error:
Since the database is stored on a dedicated MySQL server, is uses
"username@lsh135.siteprotect.com" to associate "username" the username
and the "lsh135.siteprotect.com" the web server name for security.
Is there a way to change/strip the web server name that will allow me to upload the text file with just the real username?
Is there some other way I can upload a file into a table?
Thanks,
Jim