Am working with Wordpress VM.

I have created a new account with PHPAdmin and a new database

I am attempting to connect using simple PHP connect script, but it fails with new database.

I can log in through PHP web admin and see account and database. (Text password works)

My PHP connection script will work if I remove password requirement, and do not use password.

My PHP connection script will work if I log in to wordpress DB if I use credentials and encrypted password from wordpress php wp-config.php. (this is a 32 character string).

I can not duplicate method of encryption, or disable it.

I have tried several methods (md5 ...) of encryption to generate encrypted code, and used Exported encrypted password from Myphpadmin GUI, but none work  (and are not 32 character strings)

My question is how do I generate the passord encryption for PHP login to Mysql db ?

Is this Encryption method going to effect login to remote DB (non Mysql), and if so how do I turn it off.



Jeremy Davis's picture

Although the WordPress DB user has a random string password it is not encrypted (actually the term you are after is not actually encryption, it's hashing). So the password that WordPress uses to connect to it's own database is not hashed

Perhaps where the confusion is coming in is that PHP apps such as WordPress hash the passwords of the users (which are stored in the WordPress DB) - but not the MySQL password used to connect to the DB (i.e. connect the PHP app to its DB).

Perhaps have a read here (about halfway down).

Add new comment