How to setup MySQL on Server?! - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

How to setup MySQL on Server?!

Hi,

I have MySQL which works fine on my machine. I want to setup it on server. I put OK username and pass but whatever I put as host I get:

DATABASE:

Warning: Access denied for user: 'www-data@localhost' (Using password: NO) in /home/la008vma/www/home/Baza/kreiraj.php on line 3

Warning: MySQL Connection Failed: Access denied for user: 'www-data@localhost' (Using password: NO) in /home/la008vma/www/home/Baza/kreiraj.php on line 3

Warning: MySQL: A link to the server could not be established in /home/la008vma/www/home/Baza/kreiraj.php on line 3
Error creating database: Access denied for user: 'www-data@localhost' (Using password: NO)

If I wrote like this:

<?php
$host = "www.ime.com";
$username = "un";
$password = "pa";
$ladb = mysql_connect($host, $username, $password);
mysql_select_db("imebaze",$voiddb);
?>

or

<?php
$host = "localhost";
$username = "un";
$password = "pa";
$ladb = mysql_connect($host, $username, $password);
mysql_select_db("imebaze",$voiddb);
?>

I got same problem. What is problem? Username and pass is 100% OK because I got it from administrators and owner of domain.

Thanks.

LJUBA

Comments

  • iDaZeiDaZe Posts: 464Member
    Try leaving the $host parameter blank
    like mysql_connect('', $user, $pass);

    this usualy works ok ik MySQL is on the same Server
  • ljubaljuba Posts: 106Member
    : Try leaving the $host parameter blank
    : like mysql_connect('', $user, $pass);
    :
    : this usualy works ok ik MySQL is on the same Server
    :

    Thank You very much but I found solution ... they 'forgot' to give me path to database mysql.bla.bla.bla .. they gave to me only web host :((( Amateurs ...
Sign In or Register to comment.