Jump to content

mysql connections


kadamsurekha

Recommended Posts

hello

 

 

my code is:-

 

<?php

$link = mysql_connect('localhost:3306', 'mobis', '');

 

if (!$link) {

  die('Could not connect: ' . mysql_error());

}

else

{

echo "connection";

}

mysql_close($link);

 

?>

 

if i try with this code it is fine with my server.

 

but when i try for my online site it gives me the foll msg:-

 

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'mobis'@'localhost' (using password: NO) in /home/httpd/vhosts/mobishoptalk.fritzdsouza.com/httpdocs/wel.php on line 99

Could not connect: Access denied for user 'mobis'@'localhost' (using password: NO)

 

line 99 :  $link = mysql_connect('localhost:3306', 'mobis', '');

 

i hav hosted my site using filezilla server.

do i need any configurations there or in mysql?

can u tell me the soln

 

thx

Link to comment
https://forums.phpfreaks.com/topic/41964-mysql-connections/
Share on other sites

looks like the password is wrong, You may not be able to use blank passwords. Also make sure your hosting company's mysql server is in fact at localhost. One of my old hosts was something totally different. Also hosting companies usually append the account name to the username. Might want to check the hosting companies FAQ section.

 

Ray

Link to comment
https://forums.phpfreaks.com/topic/41964-mysql-connections/#findComment-203467
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.