Login … through WP or something else?
This doesn’t look like EITHER a WordPress nor a MultiSite issue
This is a Mysql problem. I need to login to a remote server using the php mysql_connect function in WP. I believe it is a problem with the encryption of passwords. I just can’t believe that developers don’t use a remote MySql server if they want multiple WP sites to store user and other information in one database.
I just can’t believe that developers don’t use a remote MySql server if they want multiple WP sites to store user and other information in one database.
We don’t. We use MultiSite and have multiple sites call one database.
http://codex.wordpress.org/Create_A_Network
A remote server is a different thing, though, and doesn’t matter between single and multi (by the way, best to use MySQL 5 – it’ll be required as of v 3.2)
I’m running version 5.5.8 where I get the error.
I’m using:
$con=mysql_connect(‘70.87.224.194:3306’,DB_USER,DB_PASSWORD);
This works fine for localhost but not for a remote server. The problem is the password. 5.2+ seems to require an encripted password with a 24 character length instead of the old 12 character length in 4.1.
It just seems like a simple change needs to be made. But I don’t know what needs to be done. Do you know anyone doing this?
Bill
I don’t. Everyone who uses WordPress to point to a remote DB does it the ‘normal’ way.
define('DB_HOST', 'xxx.xxx.xxx.xxx:port');
or define('DB_HOST', 'db.domain.com:port');
http://codex.wordpress.org/Editing_wp-config.php#Possible_DB_HOST_values
I honestly can’t understand what you’re trying to do, or what it has to do with WordPress, which has a built in handler for a remote DB. It looks like you’re re-inventing the wheel.
Unfortunately, I don’t think that we are not on the same page. It seems to be a password issue not a Mysql server issue. I have defined the HOST with the IP and port# which is when I get the error I first submitted regarding the password. I appreciate your help but think I should post this on other forums as well.
Thanks, again you have been very helpful. If you hear of anyone else having this problem, I would apprciate a heads up.
Bill
HOW are you submitting the password?
You said you’re using
$con=mysql_connect('70.87.224.194:3306',DB_USER,DB_PASSWORD);
Is this custom crafted code? What?
Honestly, you’re right, we’re NOT on the same page, because (as this is a WP forum AND a MultiSite subforum), I’m working hard to figuring out if this has ANYTHING to do with either of them 🙂 I don’t really think it does, but I’m giving the benefit of the doubt.
This is a Mysql problem. I need to login to a remote server using the php mysql_connect function in WP.
What for? Why? Via a plugin or a php page or … what? Is this a secondary database where you have something totally non WP related or the one where you’ve stored your WordPress posts because you’ve split them up?
I don’t have enough info here 🙂
Good points. Here’s the story.
My Plugin is connected to a retail/bidding site that is very successful. It is crucial that I track the users of the plugin with unique IDs that need to be held in a single consolidated database repository that our plugin uses and controls so that when users communicate with the store site we are linking to they are identified with their ID and parameters that need to be passed in order to return a page with the resulting data set. Thus, I need to have each user add/modify/delete information in the remote Mysql database. The problem is that I cannot currently access the remote site with the connection string containing the IP and Port address of the remote server. For some reason that is still unclear, the password encryption does not seem to work with the PHP version 5.3+ that we currently use. It appears that the new PHP versions use a different password encryption method. Somehow, I need to revert to the old encryption method before sending the connection string to make it work. So far, the response I’m getting from my exhaustive search on this problem, either doesn’t work or is unacceptable. I, for the life of me, do not understand why a new version of PHP is incompatible with older versions. Backwards compatibly is the usual norm. That is the dilemma.
Thank you in advance for any help,
Bill
Running back to this older error…
mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication.
You’re on PHP 5, what version of SQL? WordPress requires 5 (it will as of version 3.2) and it’s possible that its remote connection calls need that too.
The remote server is running MySQL 5.0.45 WP 3.1.3
My development server where the call is being made is running MySQL 5.5.8 and PHP 5.3.5 WP 3.1.3
Hope this helps,
Bill