• hello when I active your plugin I have this error when I navigate in admin

    Warning: mysqli_real_connect(): (08004/1040): Too many connections in ***/wp-includes/wp-db.php on line 1490
    
    Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in ***/wp-includes/wp-db.php on line 1520
    
    Warning: mysql_connect(): Too many connections in ***/wp-includes/wp-db.php on line 1520
    
    Error establishing a database connection
    This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at localhost. This could mean your host’s database server is down.
    ?	Are you sure you have the correct username and password?
    ?	Are you sure that you have typed the correct hostname?
    ?	Are you sure that the database server is running?
    If you’re unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.

    Perhpas it’s in conflict whith loginizer or wordfence?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author tokkonopapa

    (@tokkonopapa)

    Hi @ajna667,

    In my enviromnent (MAMP on localhost, PHP 5.6.10/5.5.26, WP 4.7, single site), there is no conflict with wordfence, loginizer and IP Geo Block.

    And when I google this type of error/warning, I can get many results in WP forums but none of these are resolved.

    So I’ll show you my investigation but I don’t have confidence in myself those can resolve your issue.

    Warning: mysqli_real_connect(): (08004/1040): Too many connections in ***/wp-includes/wp-db.php on line 1490

    I think you can try to increase max_connections according to https://dev.mysql.com/doc/refman/5.5/en/too-many-connections.html by mysqld command.

    And as for

    Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in ***/wp-includes/wp-db.php on line 1520

    I think WordPress still uses legacy code in wp-db.php so that this warning occurs. This would be happened especially in PHP 5.5+.

    And I also think we need some discussions about this topic until we resolve this.

    Thanks for your reporting.

    Thread Starter ajna667

    (@ajna667)

    impossible to make test of increase “max_connections”, I dont have access to this variable.

    Plugin Author tokkonopapa

    (@tokkonopapa)

    I don’t have any idea why

    impossible to make test of increase “max_connections”, I dont have access to this variable.

    This plugin do nothing special when it handles the mysql db. It calls some functions via global variable $wpdb in a WordPress standard way.

    But even if I don’t have any errors, it doesn’t mean you have no error just because the environment of mine and yours are different. So I think this issue might be caused by something around your mysql.

    I assume that you are trying on your localhost because the error message you posted includes that host name.

    I recommend you to check your MySQL environment variables. For example, you can check max_connections on your phpMyAdmin from “More” => “Variables” => “max connections”. When you find it as 151 which means a default, it’s worse to increase the value because it depends on your environment (e.g. how many plugins you install). An example is shown in the https://dev.mysql.com/doc/refman/5.5/en/set-variable.html :

    SET GLOBAL max_connections = 1000;
    SET @@global.max_connections = 1000;
    Plugin Author tokkonopapa

    (@tokkonopapa)

    Sorry I miss spelled ^^;

    When you find it as 151 which means a default, it’s worth to increase the value because it depends on your environment

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘error after activation’ is closed to new replies.