Dear Friends,
I am having a local Linux server which have MySQL
database. I am loging to MySQL by administrative user
root. I have two tables in the database lngsnet, the
table names are count and product. I want to load the
text file which have 25 lines / records which is stored
in the /tmp directory into the product table. Using the
following coding, I was able to display the content
from the table count and load the content of the text
file product.txt into the table product successfully.
<?php
mysql_connect("localhost","root","vinodb")
or die ("cannot connect to mysqld");
mysql_select_db("lngsnet")
or die("cannot select database");
$result = mysql_query("select * from count");
$row = mysql_fetch_row($result);
echo("COUNT=$row[0]");
echo("<br>");
$query= "load data local infile /tmp/product.txt into
table product fields terminated by ,";
mysql_query($query) or
die(mysql_error());
?>
<h2>Data successfully inserted<h2>
Now I have a web space www.lngs.net with mysql support.
In the web, I have created the same database and table
on web. I have granted the permission to Select, up-
date, Insert etc.. to the database lngsnet. The web is
having PHPmyadmin support. Using PHPmyadmin, I am able
to load the text file into the product table which is
on the web. The text file is in my local hard disk.
When I checked the 25 records are inserted into the
table.
Subsequently I have loaded above codings
(post_data.php) on the web and the product.txt file
into the /tmp directory which is available on web.
This /tmp directory is having read, write, delete,
execute permissions. Now the error is
I am able to display the content of the table count on
the screen. When it is executing the load query, it is
showing the error on the browser that
COUNT=006
Access denied for user:root@localhost (Using Passwor-
dYES)
Please suggest me how to over come the problem
Regards,
Vinod
-------------------------------------------------
Sify Mail - now with Anti-virus protection powered by Trend Micro, USA.
Know more at http://mail.sify.com
One click here and you could be counting money!
StreetsCall from Walletwatch.com. Subscribe now!
http://www.walletwatch.com/cgi-bin/ww/walletwatch/equity/news_articles/news_detail.jsp?oid=11658894
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php