[wp-trac] [WordPress Trac] #52648: Problem with certain passwords not working to login to mysql db

WordPress Trac noreply at wordpress.org
Thu Feb 25 03:26:24 UTC 2021


#52648: Problem with certain passwords not working to login to mysql db
--------------------------+-----------------------------
 Reporter:  kellnerp      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  5.2
 Severity:  major         |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 After migrating my WordPress blog from 1and1 hosting to a FAMP server the
 blog would not come up and complained it couldn't connect to the database.
 When the database was migrated the same username and password were
 retained from the 1and1 site. I traced the problem to wp-db.php in wp-
 includes on the following line:

  @mysqli_real_connect( $this->dbh, $host, $this->dbuser,
 $this->dbpassword, null, $port, $socket, $client_flags );

 By hardcoding this password into this line:
  @mysqli_rea$this->dbpasswordl_connect( $this->dbh, $host, $this->dbuser,
 "SpivknocKs3%", null, $port, $socket, $client_flags );

 The WordPress blog would come up. (Note this is no longer the password for
 the database.)

 I also echoed $this->dbpassword and it was the same as the hard coded
 password but  only the hardcoded version of the password would allow a
 connection to the database.

 I changed the password for the database to one containing only upper and
 lowercase characters and numbers and it would connect fine and the blog
 would work. The problem was not quite this easy however. It also depended
 on whether I was logging in as "user"@"localhost" or "user"@"127.0.0.1".
 Both users existed on the mysql database and both had the same GRANTS.

 I tested the mysqli_real_connect() call independent of WordPress using the
 CONSTANT declarations from wp-conf.php pasted into the php manual
 reference code for this call and got similar results.

 I had moved the blog to a server running FreeBSD 12, apache 2.4, php 7.4,
 and mysql 5.7 when this problem started. I am currently running WordPress
 5.2.9 running Arclite theme.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52648>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list