Jump to content

Access denied for user 'estatec'@'localhost' (using password: NO)


Recommended Posts

I got this error message "Access denied for user 'estatec'@'localhost' (using password: NO)" and Im not sure why because I had configured all the data in a file named "datosconeccion.php" that just contains all conection data and it looks like this:

 

  <?

  $dbServer = 'localhost';

  $dbUser = 'estatec';

  $dbPassword = '********';

  $dbName = '*******';

  ?>

 

Then in the main script I have something like this

 

<?php

  include("/datosconeccion.php");

 

  $mysql = mysql_connect($dbServer, $dbUser, $dbPassword) or die(mysql_error());

 

  mysql_select_db( $dbName );

 

Im using version 5.2.17 of PHP. I tried to declare the same vars in the main script and it worked so Im not really sure why with the include is not working. Any help will be really apreciated

Since Im on a shared webserver I have no access to the root account for security reasons but as I mentioned before if I just copy  the info in "datosconeccion.php"

 

$dbServer = 'localhost';

  $dbUser = 'estatec';

  $dbPassword = '********';

  $dbName = '*******';

 

and paste it in the same document before the sql query it works even if I just hardcode the password it works. I mean the include includes all data except the password and Im starting to become crazy ):

man are you READING Im sorry. This is the third time I say that the same username and password, even server and database was moved to the same script as the one that connects to the database and when I did that IT WORKED so..... the username has permissions and the password is typed correctly. The only trouble Im having is that when I copy the same data to another script (for security reasons) and I try to use include it seems to include all the conection data except the password. How do I know this? because if it were not including it how does the php knows that the username is estatec and the hostname is localhost. What makes me freak out is that it says passord NO and I did typed a password and it is correct in the external script.

 

To be more explicit when I said I moved the data to the same script what I did was this:

 

<?php

 

  $dbServer = 'localhost';

  $dbUser = 'estatec';

  $dbPassword = '********';

  $dbName = '*******';

 

  $mysql = mysql_connect($dbServer, $dbUser, $dbPassword) or die(mysql_error());

 

  mysql_select_db( $dbName );

 

Thank you very much man it worked (: I just can't explain myself why because in my php.ini short_open_tag is set to On. But anyways this fixed my problem and I appreciate it  :D once again Thank you and I hope you have a nice day

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.