Hi friends,
I own a domain with MySQL support. I have created a database
\"lnet_cal\" on the web and also table \"yarntype\", using PHP Myad-
min on the webspace and also granted all access privileges to
user \"lnet_root\" to the database.
I had uploaded a PHP module on the web which is having three
parts. a. connection part, b. selection part and 3. loading a
text file into the table part. (The text file is also loaded in
web space (/home/lnet/public_html/public_html/yarntype.txt)
When I loaded the script on the web browser, The selection part
(b) is working fine and the result is displayed on screen and
the loading the text file part(c) I am receiving the following
error in the browser.
\"Access denied for user: \'lnet_root@localhost\' (Using password:
YES)\"
When I tried to insert the same text file using PHP Myadmin
provided by the web provider, the text file was inserted to the
table with out any problem. When the same text file is inserted
through PHP scripts, I have got the access denied error. The same
script is working fine when I executed it in a local machine.
Please suggest me on how to overcome the problem.
The script which I have loaded is as follows.
----------------------------------------------------------------
<?php
// (a)
mysql_connect(\"localhost\",\"lnet_root\",\"abcdefgh\")
or die (\"cannot connect to mysqld\");
mysql_select_db(\"lnet_bombay\")
or die(\"cannot select database\");
//(b)
$result = mysql_query(\"select * from count\");
$row = mysql_fetch_row($result);
echo(\"COUNT=$row[0]\");
echo(\"<br>\");
// THE ABOVE QUERY IS WORKED FINE AND THE SELECTED CONTENT IS
DISPLAYED ON BROWSER AS FOLLOWS
// COUNT=010
// (c)
$query= \"load data infile \'/home/lnet/public_html/calcutta/yarn
type.txt\' into table yarntype fields terminated by \',\' \" ;
mysql_query($query) or
die(mysql_error());
// THE ABOVE QUERY HAD DISPLYED THE ERROR AS FOLLOWS
// \"Access denied for user: \'lnet_root@localhost\' (Using pass
word: YES)\"
?>
----------------------------------------------------------------
Regards,
Vinod.B
-------------------------------------------------
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