Title: MySQL57-RH
Last modified: October 15, 2018

---

# MySQL57-RH

 *  Resolved [TuteurWeb](https://wordpress.org/support/users/michelandre/)
 * (@michelandre)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/mysql57-rh/)
 * Hi all,
 * I installed the RedHat Collection MySQL57-RH in my Linux.
 * I installed WordPress-4.9.8 and used this variable in wp-config.php to define
   MySQL57 as default:
 * define(‘DB_HOST’, ‘localhost:/var/lib/mysql/mysql57.sock’);
 * All is working well and WordPress’s extension Duplicator is using MySQL57.
 * I am trying to install Wordfence extension and it uses the default MySQL from“/
   var/lib/mysql/mysql.sock”. I connot find the same kind of parameter as in WordPress
   for Wordfence.
 * I created a file in /etc/profile.d/ to define MySQL57 as the default for the 
   use of MySQL but still, Wordfence does not use MySQL57.
 * Any suggestion appreciated,
 * Michel-André

Viewing 12 replies - 1 through 12 (of 12 total)

 *  [wfasa](https://wordpress.org/support/users/wfasa/)
 * (@wfasa)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/mysql57-rh/#post-10795944)
 * Hi [@michelandre](https://wordpress.org/support/users/michelandre/)!
    Wordfence
   uses mySQLi when available. I wonder if it could be related to that? Do you still
   have this problem if you do a fresh install of Wordfence *after* you’ve changed
   DB_HOST?
 *  Thread Starter [TuteurWeb](https://wordpress.org/support/users/michelandre/)
 * (@michelandre)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/mysql57-rh/#post-10796068)
 * Hi wfasa,
 * It is a “bug” of Wordfence when it reports MySQL version.
 * ** Wordfence > Tools > Diagnostics > MySQL = Version de la base de données 5.7.16
 * ** Wordfence > Tools > Diagnostics > Other Tests > Clic here to display… > mysql
   > mysql.default_socket = /var/lib/mysql/mysql.sock
    – This is wrong as there 
   is no Table for wf… in standard MySQL only in MySQL57 there are a few.
 *     ```
       # mysql WPBD -e "show tables;"
       ERROR 1049 (42000): Unknown database 'WPBD'
       ```
   
 *     ```
       ]# mysql57 WPBD -e "show tables;"
       +---------------------------------------+
       | Tables_in_WPBD                        |
       +---------------------------------------+
       ...
       | Toto0327_wfblockediplog               |
       | Toto0327_wfblocks7                    |
       | Toto0327_wfconfig                     |
       | Toto0327_wfcrawlers                   |
       | Toto0327_wffilechanges                |
       | Toto0327_wffilemods                   |
       | Toto0327_wfhits                       |
       | Toto0327_wfhoover                     |
       | Toto0327_wfissues                     |
       | Toto0327_wfknownfilelist              |
       | Toto0327_wflivetraffichuman           |
       | Toto0327_wflocs                       |
       | Toto0327_wflogins                     |
       | Toto0327_wfnotifications              |
       | Toto0327_wfpendingissues              |
       | Toto0327_wfreversecache               |
       | Toto0327_wfsnipcache                  |
       | Toto0327_wfstatus                     |
       | Toto0327_wftrafficrates               |
       +---------------------------------------+
       ```
   
 * ** mysqli > mysqli.default_socket = /var/lib/mysql/mysql.sock
    – This is impossible.
 * ** In Duplicator extension: Duplicator > Tools > MySQL = Version 5.7.16
 * So I say “This is a bug…”
 * Michel-André
 *  Thread Starter [TuteurWeb](https://wordpress.org/support/users/michelandre/)
 * (@michelandre)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/mysql57-rh/#post-10796104)
 * Solution:
 * Wordfence is looking in php.ini instead of in wp-config.php
 * In wp-config.php, I have already defined:
 *     ```
       define('DB_HOST', 'localhost:/var/lib/mysql/mysql57.sock');
       ```
   
 * In php.ini, by default, socket’s path is not defined:
 *     ```
       mysql.default_socket =
       ```
   
 * In php.ini, you have to add:
 *     ```
       mysql.default_socket =  /var/lib/mysql/mysql57.sock
       mysqli.default_socket =  /var/lib/mysql/mysql57.sock
       ```
   
 * Michel-André
 *  [wfasa](https://wordpress.org/support/users/wfasa/)
 * (@wfasa)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/mysql57-rh/#post-10815351)
 * Hi [@michelandre](https://wordpress.org/support/users/michelandre/),
    Sorry for
   the late reply. Thanks for sharing your solution! I’m a bit confused by it because
   we use the WordPress $wbdb for database connections, so this shouldn’t be happening.
   I’ll forward this to the team though, so we can double check.
 *  [wfasa](https://wordpress.org/support/users/wfasa/)
 * (@wfasa)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/mysql57-rh/#post-10815565)
 * Hi [@michelandre](https://wordpress.org/support/users/michelandre/),
    Just wanted
   to verify something. Is it correct that the only place you saw the “wrong” value
   was in the window that opens when you clicked “Click here to display your system
   information”? That window just shows a phpinfo() printout, which is the settings
   as defined in your php.ini and that is not something Wordfence controls.
 * If so, that’s not a bug. Just wondering if you had any actual problems with the
   configuration?
 *  Thread Starter [TuteurWeb](https://wordpress.org/support/users/michelandre/)
 * (@michelandre)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/mysql57-rh/#post-10815624)
 * Hi wfasa,
 * Yes, this is the only place.
 * Then why is Duplicator and WooCommerce are both displaying the correct version
   and not Wordfence?
 * Michel-André
 *  [wfasa](https://wordpress.org/support/users/wfasa/)
 * (@wfasa)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/mysql57-rh/#post-10815656)
 * Hi [@michelandre](https://wordpress.org/support/users/michelandre/),
    I suppose
   they are not showing you a phpinfo() printout anywhere? If they did, they’d be
   showing the exact same thing as you see when you click “Click here to display
   your system information”. All that function does is print out phpinfo(). That’s
   the exact same information you would get if you created a .php file yourself 
   containing only
 * <?php
    phpinfo(); ?>
 * The Wordfence Diagnostics page also has a section called MySQL which I believe
   you said did show 5.7.16?
 *  Thread Starter [TuteurWeb](https://wordpress.org/support/users/michelandre/)
 * (@michelandre)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/mysql57-rh/#post-10815862)
 * Hi wfasa
 * I do not know what they use but they display the correct information.
 * Your little script display the wrong info; same as yours.
 * Wordfence > Tools > Diagnostics > MySQL > version is 5.7.16 which is correct.
 * The page displayed by: “Click here to display your system information”
    is called:“
   Wordfence System Info **for** PHP Version 7.1.22″, it should be: “Wordfence System
   Info **of** PHP Version 7.1.22″
 * Michel-André
 *  [wfasa](https://wordpress.org/support/users/wfasa/)
 * (@wfasa)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/mysql57-rh/#post-10816011)
 * Hi [@michelandre](https://wordpress.org/support/users/michelandre/),
 * The Wordfence specific diagnostics (Wordfence > Tools > Diagnostics > MySQL >
   version) displays the version WordPress is using.
 * The output in “Click here to display your system information” and the script 
   I provided is not “wrong” information. It’s exactly what is in your system php
   configuration. Please see the PHP docs for reference: [http://php.net/manual/en/function.phpinfo.php](http://php.net/manual/en/function.phpinfo.php).
   Wordfence includes a function for viewing what your actual underlying PHP configuration
   is. The other plugins don’t. That’s the only difference.
 *  Thread Starter [TuteurWeb](https://wordpress.org/support/users/michelandre/)
 * (@michelandre)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/mysql57-rh/#post-10816088)
 * Hi wfasa,
 * > Wordfence includes a function for viewing what your actual underlying PHP configuration
   > is. The other plugins don’t. That’s the only difference.
 * Duplicator > Tools > Diagnostics > Information > PHP Information, Displays <u
   >_exactly the same informations as yours_</u>.
 * > for viewing what your actual underlying PHP configuration <u>is</u>
 * As you wrote <u>is</u> not <u>for</u>.
 * Other extensions might be small but they display in other languages… Please see
   other extensions for reference…
 * Michel-André
 *  [wfasa](https://wordpress.org/support/users/wfasa/)
 * (@wfasa)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/mysql57-rh/#post-10816388)
 * Hi again [@michelandre](https://wordpress.org/support/users/michelandre/),
 * If Duplicator displays the same information, what is the problem exactly?
 *  [wfdave](https://wordpress.org/support/users/wfdave/)
 * (@wfdave)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/mysql57-rh/#post-10862342)
 * Hi [@michelandre](https://wordpress.org/support/users/michelandre/),
 * We haven’t heard back from you in a while. I’ve gone ahead and marked this thread
   as resolved. If you’re still having issues with Wordfence, feel free to open 
   another thread.
 * Thanks!

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘MySQL57-RH’ is closed to new replies.

 * ![](https://ps.w.org/wordfence/assets/icon.svg?rev=2070865)
 * [Wordfence Security - Firewall, Malware Scan, and Login Security](https://wordpress.org/plugins/wordfence/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordfence/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordfence/)
 * [Active Topics](https://wordpress.org/support/plugin/wordfence/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordfence/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordfence/reviews/)

 * 12 replies
 * 3 participants
 * Last reply from: [wfdave](https://wordpress.org/support/users/wfdave/)
 * Last activity: [7 years, 6 months ago](https://wordpress.org/support/topic/mysql57-rh/#post-10862342)
 * Status: resolved