mysqli_real_connect: warning

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
dukey.

mysqli_real_connect: warning

Post by dukey. »

I'm using php5 and am receiving the following error;

Warning: mysqli_real_connect() [function.mysqli-real-connect]: Unknown MySQL Server Host 'localhost:3306' (11001) in c:\server\apachegroup\Apache\htdocs\cmsmadesimple\adodb\drivers\adodb-mysqli.inc.php on line 83
Connection failed

.db has been created and the user has set privileges for named database. I've convirted the authentication back to OLD_Password format aswell. Can someone please provide some assistance.

Regards.
dukey.

mysqli_real_connect: warning

Post by dukey. »

problem solved.
Frog

Re: mysqli_real_connect: warning

Post by Frog »

I get this same error but have no idea what is wrong... wouldn't it have been useful if the person had explained how they had fixed it.... oh well guess I'm heading for a different cms
Frank

Re: mysqli_real_connect: warning

Post by Frank »

dukey. wrote: problem solved.
HOW???
SirChiba

Re: mysqli_real_connect: warning

Post by SirChiba »

I get the same error message. It would be greatly appreciated if anyone could help. What did you do, Dukey?

I am using:
Win32
Apache 2.0.53
PHP 5.0.3
MySQL 4.1
CMSMadeSimple 0.9.2
Last edited by SirChiba on Mon Mar 14, 2005 9:09 pm, edited 1 time in total.
jptechnical
Forum Members
Forum Members
Posts: 131
Joined: Wed Jan 12, 2005 12:18 am

Re: mysqli_real_connect: warning

Post by jptechnical »

that error usually indicates that the mysql server could not be found.

So, check that the mysql service is running and make sure it has the right port number. If you are running this on a windows box from the command prompt type 'netstat -a' and look for the port number 3306 (host:port#) under the local address column. If you find it then your mysql server is running, if you have a 3307 it is possible the mysql service is running twice and has taken the next available port number 3307.

At least see if it is running and go from there.
SirChiba

Re: mysqli_real_connect: warning

Post by SirChiba »

Hi, jptechnical,

thanks for answering! Sadly, I still get the same error. The mySQL server is running fine on 3306. Permissions are set for cms_user and the mySQL and Apache services have been restarted numerous times.

Note: I had to add the php_mysqli extension to php.ini to get past step 3 in the installation process.

S
Last edited by SirChiba on Tue Mar 15, 2005 1:19 pm, edited 1 time in total.
jptechnical
Forum Members
Forum Members
Posts: 131
Joined: Wed Jan 12, 2005 12:18 am

Re: mysqli_real_connect: warning

Post by jptechnical »

If memory serves me, during the installation you are given a drop down choice of your mysql version. Have you tried changing that? I think I had a problem with that on a windows test box and I just set it to use the older mysql version and it worked.

Otherwise, make abesolutely sure that the files in the adodb dir are good. Try re-uploading them or even download the latest version from the web. Only copy over the files that you already have in your directory.
SirChiba

Re: mysqli_real_connect: warning

Post by SirChiba »

IT WORKS!! I set the drop down menu to "MySQL 3.x / 4.0" instead of setting it to the version I am actually using, namely 4.1. A bit quirky, but golly it works!

Thanks a heap, jptechnical!

S
jptechnical
Forum Members
Forum Members
Posts: 131
Joined: Wed Jan 12, 2005 12:18 am

Re: mysqli_real_connect: warning

Post by jptechnical »

Right on.

Perhaps someone could explain the real differences between the 2 choices. I think I have always chosed the older version perhaps as being more compatible?
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: mysqli_real_connect: warning

Post by Ted »

Basically, I have both options there because there is a flux right now between versions.  Generally, mysql 4.1 requires the mysqli library to handle it's new password handling format.  However, most prepackaged version of php (especially for windows) do not include the mysqli library by default.  So, the workaround for using 4.1 is setting your passwords to be stored in the older format (this is set in my.ini), in which case the 3.x/4.0 driver will work in "compatibility" mode.  Of course, you can't just change the format...  you need to also reset all of your current passwords after you make this change.

It's a sticky situation, and not being handled well by the people prepackaging php.  4.1 is now considered stable and recommended for all new development.  PHP should be acknowledging this fact...

I'm just trying to handle it as best I can.
jptechnical
Forum Members
Forum Members
Posts: 131
Joined: Wed Jan 12, 2005 12:18 am

Re: mysqli_real_connect: warning

Post by jptechnical »

Of course, you can't just change the format...  you need to also reset all of your current passwords after you make this change.
You are talking bout the database password not the user passwords in the admin right?

I have a bunch of installs all with the older setting, if a new version requires it will I just need to change my database password or am I looking at changing the passwords for users in the admin? When you say reset... what exactly do you mean?

thanks.
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: mysqli_real_connect: warning

Post by Ted »

Sorry.  Yeah, database user passwords.  CMSMS passwords are created in php using md5 sums (for database independence reasons)

By reset, I mean actually go back and set the passwords for every database user in mysql.

Make sense?
jptechnical
Forum Members
Forum Members
Posts: 131
Joined: Wed Jan 12, 2005 12:18 am

Re: mysqli_real_connect: warning

Post by jptechnical »

yes, thanks.
piratos

Re: mysqli_real_connect: warning

Post by piratos »

The mysqli - error must be a adodb error or otherwise.

Test your mysqli - installation as follow and dirctly

Code: Select all

<?php 

/*
Zuerst erzeugen wir ein neues Objekt mit dem Namen $mysqli und verbinden uns zum Server. Ab sofort werden wir nur noch auf das Objekt zugreifen

server, user, password, database
*/

$mysqli = new mysqli('localhost', 'root', 'yourpassword', 'cmsfrisch'); 


/*
Wir prüfen, ob es zu einem Fehler kam beim Verbindungsaufbau mit der Datenbank. Sofern dies zutrifft, brechen wir das Script durch die() ab.
*/
if (mysqli_connect_errno()) { 
   die("Konnte keine Verbindung herstellen");
} 

/*
Wir rufen nun verschiedene Daten aus der Datenbank ab. Sofern die Abfrage erfolgreich war, wird die das Ergebnis in der Variable $result gespeichert. Man beachte, dass wir das Query als Objektfunktion $mysqli->query abrufen
*/
if ($result = $mysqli->query('SELECT content FROM cms_content_props')) { 


    /*
    Hier bilden einen Array und geben das Ergebnis aus
    */
    while( $row = $result->fetch_assoc() ){ 
        echo "Inhalt: ". $row["content"];
    } 

    /*
    Wir geben den Speicher frei.
    */
    $result->close(); 
} 
/*
Dies ist Meldung, sofern keine Daten aus der Datenbank ausgelesen werden können.
*/
else {
    echo "Es konnten keine Daten aus der Datenbank ausgelesen werden";
}


/*
Verbindung trennen.
*/
$mysqli->close(); 
?>
If it run there was an error in adodb or in cms.

You can also run phpmyadmin with mysqli as follow.
change this

Code: Select all

$cfg['Servers'][$i]['extension']     = 'mysql';     // The php MySQL extension to use ('mysql' or 'mysqli')
to

Code: Select all

$cfg['Servers'][$i]['extension']     = 'mysqli';     // The php MySQL extension to use ('mysql' or 'mysqli')
and restart phpmyadmin. Now it will use mysqli.
Locked

Return to “[locked] Installation, Setup and Upgrade”