Re: Fw:
| From: | Ulrik S. Kofod | Date: | Tue, 15 Jun 2004 06:23:48 +0000 |
| Subject: | Re: Fw: | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-188299@lists.php.net to get a copy of this message | ||
I'm not sure but I think that it is because you give the port number :3308 in the
connect.
the connection is not established the same way as when you just give just
"localhost" and mysql might not see "user" the same way.
I think it will work if you grant access to 'user@%' or 'user@<hostname>'
But with the info given this is just a guess.
Travis Low sagde:
> $conn = mysql_connect("localhost:3308","user","password");
>
> You are connecting as user "user" with password "password" in the code, yet
> the
> error message references "finfaq@localhost" so I'm pretty confused.
>
> cheers,
>
> Travis
>
> Sriranganath wrote:
>> ----- Original Message -----
>> From: Sriranganath
>> To: php-general@lists.php.net
>> Sent: Tuesday, June 15, 2004 9:50 AM
>>
>>
>> Dear Sir,
>> I am finding difficulty in inserting a record into a MySQL DB through PHP inpsite
>> of all the privileges given to that database . Can u plz clarify it?
>>
>> Plz let me know what are all the processes that i have to start or include ..;;;
>> in my files:
>>
>>
>>
>> Plz go through my code: and associated erors messages :
>>
>> <?php
>> if (isset($_POST['submit'])) {
>> $conn = mysql_connect("localhost:3308","user","password");
>> mysql_select_db("database");
>> $query = "insert into branch (sol_id,sol_desc,ip_address,email_id) values
>> ('".$_POST['solid']."',
>> '".$_POST['brname']."',
>> '".$_POST['ipadd']."',
>> '".$_POST['email']."')";
>> if (mysql_query($query))
>> echo 'Success';
>> else
>> echo 'Failed';
>> }
>> else {
>> ?>
>> <center>
>> <form method="post" action="<?=$_SERVER['PHP_SELF']
>> ?>">
>> Sol-ID <input type="text" name="solid"><br>
>> Branch Name <input type="text" name="brname"><br>
>> IP-Address <input type="text" name="ipadd"><br>
>> E-Mail <input type="text" name="email"><br>
>> <input type="submit" name="submit" value="submit">
>> </form></center>
>> <? }
>> ?>
>>
>> after submitting the inputs; it is giving the following errors:
>>
>> username is the finfaq and database name is also finfaq
>> password and username when i give directly to mysql, it is accepting.
>>
>>
>>
>> Warning: Access denied for user: 'finfaq@localhost' (Using password: YES) in
>> /var/www/html/whatnew/a.php on line 3
>>
>> Warning: MySQL Connection Failed: Access denied for user: 'finfaq@localhost'
>> (Using password: YES) in /var/www/html/whatnew/a.php on line 3
>> Failed
>>
>> When i try to insert directly into the table, it is allowing:.
>>
>> regards
>> Sriranganath
>>
>>
>
> --
> Travis Low
> <mailto:travis@dawnstar.com>
> <http://www.dawnstar.com>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>