Title: Error with MySQL
Last modified: August 22, 2016

---

# Error with MySQL

 *  [WP_cualquiera](https://wordpress.org/support/users/wp_cualquiera/)
 * (@wp_cualquiera)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/error-with-mysql/)
 * Hello.
 * I have WordPress v3.9.2, PHP v5.5.14, MySQL v5.1.73 and WooCommerce v2.1.12.
 * I have installed Pie Register and in the “General Settings”, I receive this error:
 * MySQL Version
    Warning: mysql_get_server_info(): No such file or directory in/
   homepages/41/xxx/htdocs/xxx/wp-content/plugins/pie-register/menus/PieGeneralSettings.
   php on line 456
 * Warning: mysql_get_server_info(): A link to the server could not be established
   in /homepages/41/xxx/htdocs/xxx/wp-content/plugins/pie-register/menus/PieGeneralSettings.
   php on line 456
 * Warning: mysql_get_server_info(): No such file or directory in /homepages/41/
   xxx/htdocs/xxx/wp-content/plugins/pie-register/menus/PieGeneralSettings.php on
   line 462
 * Warning: mysql_get_server_info(): A link to the server could not be established
   in /homepages/41/xxx/htdocs/xxx/wp-content/plugins/pie-register/menus/PieGeneralSettings.
   php on line 462
    Sorry, Pie-Register requires MySQL 5.0 or higher. Please deactivate
   Pie-Register
 * What can be the problem?
 * Thanks in advance.
 * [https://wordpress.org/plugins/pie-register/](https://wordpress.org/plugins/pie-register/)

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

 *  Thread Starter [WP_cualquiera](https://wordpress.org/support/users/wp_cualquiera/)
 * (@wp_cualquiera)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/error-with-mysql/#post-5211338)
 * I’ve been investigating, and mysql_get_server_info() is deprecated for PHP >=
   v5.5.0
 * That explains why I receive errors also after a user registers using this form.
 *  Thread Starter [WP_cualquiera](https://wordpress.org/support/users/wp_cualquiera/)
 * (@wp_cualquiera)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/error-with-mysql/#post-5211357)
 * I have made a workaround, which for the moment works.
 * I’m not a programmer, so please don’t think this is a perfect fix.
 * PieGeneralSettings.php, change line 488 by:
 *     ```
       <?php if(version_compare($mysqli->server_info,  "5.0") == 1)
       		  {
       			  echo '<span class="installation_status">'.$mysqli->server_info.'</span>';
       		  }
       		  else
       		  {
       			  echo '<span class="installation_status_faild">'.$mysqli->server_info.'</span>';
       ```
   
 * base.php, change line 758 by (look at the sourcecode of the webpage, because 
   some code is missed):
    $user = $wpdb->get_results(“SELECT`ID`,`user_login`,`user_nicename`,`
   user_email`,`user_registered`FROM`".$user_table."`WHERE`user_email`= ‘”.stripslashes(
   $user).”‘”);
 * I wish someone fixes this problem, and meanwhile this helps someone else 🙂
 *  Plugin Contributor [genetech](https://wordpress.org/support/users/genetech/)
 * (@genetech)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/error-with-mysql/#post-5211443)
 * Hello,
 * Thank you for pointing out this issue, there is quick work around for this, however
   it will be fixed in our next release.
 *     ```
       $piereg_mytsql_version_info = "";
          global $wpdb;
          if ( function_exists( 'mysqli_connect' ) ){
           if ( defined( 'WP_USE_EXT_MYSQL' ) ){
            //mysql
            $piereg_mytsql_version_info = mysql_get_server_info($wpdb->dbh);
           } elseif ( version_compare( phpversion(), '5.5', '>=' ) || ! function_exists( 'mysql_connect' ) ) {
            //mysqli
            $piereg_mytsql_version_info = mysqli_get_server_info($wpdb->dbh);
           } elseif ( false !== strpos( $GLOBALS['wp_version'], '-' ) ) {
            //mysqli
            $piereg_mytsql_version_info = mysqli_get_server_info($wpdb->dbh);
           }else{
            //mysql
            $piereg_mytsql_version_info = mysql_get_server_info($wpdb->dbh);
           }
          }else{
           //mysql
           $piereg_mytsql_version_info = mysql_get_server_info($wpdb->dbh);
          }
          if(version_compare($piereg_mytsql_version_info,  "5.0") == 1)
          {
           echo '<span class="installation_status">'.$piereg_mytsql_version_info.'</span>';
          }
          else
          {
           echo '<span class="installation_status_faild">'.$piereg_mytsql_version_info.'</span>';
           echo '<span class="quotation">'.__("Sorry, Pie-Register requires MySQL 5.0 or higher. Please deactivate Pie-Register","piereg").'</span>';
          }
       ```
   
 * You can replace this code to fix this!
 * Thanks
 *  Thread Starter [WP_cualquiera](https://wordpress.org/support/users/wp_cualquiera/)
 * (@wp_cualquiera)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/error-with-mysql/#post-5211453)
 * Thank you very much!
 * And what about base.php? I don’t know if my fix is correct 😉
 *  Plugin Contributor [genetech](https://wordpress.org/support/users/genetech/)
 * (@genetech)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/error-with-mysql/#post-5211538)
 * I did not test your fix, it is good as long as it works for you!
    This problem
   will be fixed natively in our upcoming release which is due next week!
 * Thanks

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

The topic ‘Error with MySQL’ is closed to new replies.

 * ![](https://ps.w.org/pie-register/assets/icon-256x256.png?rev=2467686)
 * [Pie Register – User Registration, Profiles & Content Restriction](https://wordpress.org/plugins/pie-register/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pie-register/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pie-register/)
 * [Active Topics](https://wordpress.org/support/plugin/pie-register/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pie-register/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pie-register/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [genetech](https://wordpress.org/support/users/genetech/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/error-with-mysql/#post-5211538)
 * Status: not resolved