MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old March 27th, 2004, 04:39 AM
metoome metoome is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 18 metoome User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 53 m 38 sec
Reputation Power: 0
connecting mysql with PHP

hello all
i a new to this group

hi..



i a new member to this forum...and i am using Red Hat 9 .
I found my problem matching with the this thread..


Thread titled as "Cannot Change GNOME Menu Items to add/change Item for Mozilla 1.3 After Upgrade "

As i followed the thread it ..i do get the same error as the last posted message in the thread and since i didn't find any follow up after this post ..i dont know what to do...

i get the following error messages
"Details: Error writing file 'applications:/Internet/redhat-web.desktop': Read-only file system"

and i also have another problem

i am not able to open .html files by double clicking with the mouse..or even by rightclick->open/openwith->mozilla.



Please Help
suresh
****************************************
insert into <table name> values(&id,'&title'&actor);

<table border=1>
<tr><th>Movie</th><th>Year</th><th>Actor</th><tr>



hello everybody

i am not able to connect to mysql databse ,i am just learning PHP, MySQL ,i use Red hat 9.
i have just written a simple program


1 <html>
2 <head><title> Bond Movies </title></head>
3 <body>
4 <?php
5 //open database connection and use dooondo databse
6 mysql_connect("localhost","ananth","kaavi123");
7 echo"$connection";
8 mysql_select_db("doondo",$connection);
9 $result=mysql_query("SELECT * FROM movies",$connection);
10 while($row=mysql_fetch_row($result))
11 {
12 for ($i=0; $i<mysql_num_fields($result);$i++)
13 echo $row[$i]. " ";
14 echo "\n" ;
15 mysql_close($connection);
16 }
17 ?>
18 </body>
19 </html>


i get the error message as

Warning: Access denied for user: 'ananth@localhost' (Using password: YES) in /home/sites/doondo/examples/bondmovies.php on line 6

Warning: MySQL Connection Failed: Access denied for user: 'ananth@localhost' (Using password: YES) in /home/sites/doondo/examples/bondmovies.php on line 6

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/sites/doondo/examples/bondmovies.php on line 8

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/sites/doondo/examples/bondmovies.php on line 9

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/sites/doondo/examples/bondmovies.php on line 10


the m/c i use has the PHP, Mysql, appache installed in it

please help

Reply With Quote
  #2  
Old March 27th, 2004, 05:12 AM
ChrisIves ChrisIves is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 8 ChrisIves User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Did you ever assign $connection to anything? Like this:

$connection = mysql_connect("localhost", "username", "password");

Reply With Quote
  #3  
Old March 27th, 2004, 10:49 PM
metoome metoome is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 18 metoome User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 53 m 38 sec
Reputation Power: 0
..oh no..
but after adding the line
$connection=mysql_connect("localhost","ananth","kaavi123");

i still get the same error

..

Reply With Quote
  #4  
Old March 27th, 2004, 11:30 PM
metoome metoome is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 18 metoome User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 53 m 38 sec
Reputation Power: 0
hello..

and when i tried a more simple program..

<html>
<body>
<?php
$conn=mysql_connect("kaavi-server","ananth","xxxxx");
?>
</body>
</html>

i get the following error
Warning: Host 'kaavi-server' is not allowed to connect to this MySQL server in /home/sites/doondo/examples/sqlconnect.php on line 4

Warning: MySQL Connection Failed: Host 'kaavi-server' is not allowed to connect to this MySQL server in /home/sites/doondo/examples/sqlconnect.php on line 4

for more info
when i tried the same code just with replacing the "kaavi-server" by "localhost" i get the following errors

<html>
<body>
<?php
$conn=mysql_connect("localhost","ananth","xxxxx");
?>
</body>
</html>


Warning: Access denied for user: 'ananth@localhost' (Using password: YES) in /home/sites/doondo/examples/sqlconnect.php on line 4

Warning: MySQL Connection Failed: Access denied for user: 'ananth@localhost' (Using password: YES) in /home/sites/doondo/examples/sqlconnect.php on line 4

more over i connect to appache webserver by

http://kaavi-server:90/examples/sqlconnect.php

for addition information

when i execute the following commands i get

[ananth@kaavi-server examples]$ hostname -d
[ananth@kaavi-server examples]$ hostname -s
kaavi-server
[ananth@kaavi-server examples]$ hostname -a
localhost.localdomain localhost
[ananth@kaavi-server examples]$ hostname -f
kaavi-server

Reply With Quote
  #5  
Old March 29th, 2004, 10:40 PM
metoome metoome is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 18 metoome User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 53 m 38 sec
Reputation Power: 0
still i am not connect to the databse....!
do i have to create a seperate user for connecting into mysql database thru php..?

Please any body help me out

Reply With Quote
  #6  
Old March 30th, 2004, 03:55 AM
crudesys crudesys is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: California
Posts: 25 crudesys User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question

hi, is your database named "doondo" or "dooondo" ?

Reply With Quote
  #7  
Old March 30th, 2004, 04:07 AM
Spongy's Avatar
Spongy Spongy is offline
Alternately High
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Hilversum, Netherlands
Posts: 223 Spongy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 56 m 41 sec
Reputation Power: 5
Send a message via MSN to Spongy
Quote:
Originally Posted by crudesys
hi, is your database named "doondo" or "dooondo" ?

Hmm, like that makes sense...
Ontopic:
Yes, you have to create a user for your MySQL. You can use the root-user, but I would disencourage that.
Do you have PHPMyAdmin installed? It's an easy tool to administrate your MySQL. Create a user which only can connect from localhost.
The connection string would then look like this:
PHP Code:
 $connect mysql_connect("localhost","newuser","password"); 

This way it should work. I get the idea that you are trying to connect with a user which doesn't have sufficient rights to do so.
[edit]
Maybe there is something wrong in your php.ini
Please first try the thing above, if it still doesn't work look if you don't have a standard user configured for your MySQL.
[/edit]

Cheers
__________________
Work to live, don't live to work

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > connecting mysql with PHP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway