Jump to content

Recommended Posts

PHP 5.2.15 and 5.3.4 (dual environment)

MySQL    5.1.52

 

I have just switched over from a Windows to a unix host

and I have changed my users to reflect the new address and the password etc; on my new host

 

I have used both  user_conn (with limited access)

                  and  sys_admin_conn.php  (with full access)

 

Using any of my phpmyedit files with either user works fine showing tables

 

But when I try to use one of my 900 plus gallery scripts they fall over with a strange message

 

Warning: mysqli_connect() [function.mysqli-connect]: (28000/1045): Access denied for user 'topshed'@'localhost' (using password: NO) in /home/topshed/public_html/gal_lt/LT1317.php on line 36

Error !! Unable to connect to database

 

the bit (using password: NO) makes no sense to me as all the user info including password  is there

the code involved is below...


  <?php 

$tble = 'LT';

$fnum = '78';

include_once("../include/user_conn.php");
    $connect = mysqli_connect($host,$account,$password) OR DIE("Error !! Unable to connect to database");
    $db = mysqli_select_db($connect,"$dbname") OR DIE( "Unable to select database ");
// echo $tble;
    $db="SELECT * FROM $tble WHERE fleet = $fnum";
if ($result = mysqli_query($connect,$db)) {  
	if (mysqli_num_rows($result)) {
			while ($row = mysqli_fetch_assoc($result)){
gallery code
include ("../include/HC_footer.php");
}}}

?>

 

My hosting company help desk chat cannot make any sense of it but of course that is not their problem the thing is all my scripts still work in a windows host enviroment

 

Any help would be most welcome

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

 

usually could means:

- The user (topshed in this case) exist but the provided password is incorrect (or null);  or

- The user topshed doesn't have the proper GRANTS for the selected DB.

"using password: NO" means that no password was passed to the connect function.  Double-check to make sure $password has been correctly initialized.  In your sample code you're not initializing any of the connection variables, if you just removed them for security reasons you'll want to make sure you have them set correctly.  If the sample code is indeed your entire code, you're not able to connect because you haven't defined any of the connection parameters.

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.