• Hi Team,

    Suddenly while accessing my wordpress website there was an error shown “Database connection Failed”.

    I have used the repair database option in the cwp_config file and repaired the database. Kindly help me with the below output from the repair function.

    Some database problems could not be repaired. Please copy-and-paste the following list of errors to the WordPress support forums to get additional assistance.

    wp_users: 45 clients are using or haven’t closed the table properly
    wp_usermeta: 48 clients are using or haven’t closed the table properly
    wp_posts: 46 clients are using or haven’t closed the table properly
    wp_comments: 45 clients are using or haven’t closed the table properly
    wp_options: Table is marked as crashed
    wp_postmeta: 47 clients are using or haven’t closed the table properly
    wp_terms: 22 clients are using or haven’t closed the table properly
    wp_term_taxonomy: 44 clients are using or haven’t closed the table properly
    wp_term_relationships: 44 clients are using or haven’t closed the table properly
    wp_termmeta: 36 clients are using or haven’t closed the table properly
    wp_commentmeta: 40 clients are using or haven’t closed the table properly

Viewing 15 replies - 1 through 15 (of 29 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Thread Starter shashikant91

    (@shashikant91)

    Hi @sterndata

    Thanks for your revert.

    Somehow I have repaired and optimized the database from the error page itself by adding the code in the wp_config file. After the db is optimized and repaired then only the above message was seen.

    You mean once I optimize or repair the db in the way you have mentioned the given error line would be fixed?

    Also, will I loose any data by doing this? I mean optimize & repair the db

    Thanks

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    You will not lose any data. PHPMYADMIN does a better job of repairing the database than the constants you added to wp-config.php; you can remove them.

    Thread Starter shashikant91

    (@shashikant91)

    Hi @sterndata

    Need an urgent help. I have somehow resolved it but running the command on the wp_config file and could resolve the issue yesterday.

    Today also the issue had again come. So I wanted to follow your suggestion by repairing the db from the cpanel/phpmyadmin.

    I am not a technical expert, I have repaired it following your link and could repair it.
    But it suggested to me check few table error which showed (site was running perfectly) some wp forum post show me to run the below command for checking the issue and once i did that everything stopped working and that command screen is loading since almost 45 min..

    I even tried to kill the query/task but somehow now I am unable to open the phpmyadmin as it’s showing error. Please find the below command which i ran and the error on php my admin screen.

    select * from wp_options where option_name in (

    SELECT replace( option_name, ‘_transient_timeout’, ‘_transient’ ) FROM wp_options WHERE option_name like ‘_transient_timeout_itsec_ipcheck_%’ and option_value < unix_timestamp()

    union

    SELECT option_name FROM wp_options WHERE option_name like ‘_transient_timeout_itsec_ipcheck_%’ and option_value < unix_timestamp()

    )

    Error
    SQL query: DocumentationEdit Edit

    SELECT CHARACTER_SET_NAME AS Charset, DESCRIPTION AS Description FROM information_schema.CHARACTER_SETS
    Open new phpMyAdmin window
    mysqli_connect(): (08004/1040): Too many connections
    mysqli_real_connect(): (28000/1045): Access denied for user ‘pcstudio’@’localhost’ (using password: NO)
    mysqli_real_connect(): (28000/1045): Access denied for user ‘pcstudio’@’localhost’ (using password: NO)
    Notice in ./libraries/classes/Config.php#909
    Undefined index: collation_connection

    Backtrace

    ./libraries/classes/Config.php#1022: PhpMyAdmin\Config->_setConnectionCollation()
    ./libraries/common.inc.php#457: PhpMyAdmin\Config->loadUserPreferences()
    ./index.php#27: require_once(./libraries/common.inc.php)
    Notice in ./libraries/classes/DatabaseInterface.php#1536
    Undefined index: charset_connection

    Backtrace

    ./libraries/classes/Config.php#911: PhpMyAdmin\DatabaseInterface->setCollation(string ‘utf8mb4_unicode_ci’)
    ./libraries/classes/Config.php#1022: PhpMyAdmin\Config->_setConnectionCollation()
    ./libraries/common.inc.php#457: PhpMyAdmin\Config->loadUserPreferences()
    ./index.php#27: require_once(./libraries/common.inc.php)
    Failed to set configured collation connection!
    Notice in ./index.php#269
    Undefined variable: collation_connection

    Backtrace

    Please help me as the website stopped and my client is yelling at me

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Do you have a backup of the database?

    >> some wp forum post show me to run the below command for checking the issue and once i did that everything stopped working and that command screen is loading since almost 45 min.. <<

    So that wasn’t a good idea.

    Thread Starter shashikant91

    (@shashikant91)

    Actually I have backed up a server backup from the cpanel yesterday.. what is this db backup specially?

    DO you mean my database is gone?

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    I’m suggesting you restore the database from a known, good backup. When you made your backup, did you include the database?

    Thread Starter shashikant91

    (@shashikant91)

    Can’t we stop or kill this in any other way?

    Thread Starter shashikant91

    (@shashikant91)

    I have a .gz file of the complete account backup. I hope it includes the database

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    stop or kill what?

    Look in your backup for a file with the extension .sql or .db or something similar.

    Thread Starter shashikant91

    (@shashikant91)

    Ok

    Will extract that zip file and check if it’s available. I have a full account backup but my hosting provider (godaddy) is saying that we will not be able to restore the complete backup from the cpanel.

    Can I extract the file and find the files which you have mentioned and replace them?

    But currently how do i stop or kill what’s running I mean that sql command. it’s still loading

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Ask GoDaddy how to kill that command. Did you do it from phpmyadmin? If so, just close the window. If from the command line, a control C should kill it.

    If you find a db backup file, you can restore it by importing in PHPMYADMIN.

    Thread Starter shashikant91

    (@shashikant91)

    I have done it from the phpmyadmin only…will closing the window kill the query? Can I do it and try..
    I was afraid it something breaks or crashes

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    If this scares you, contact GoDaddy support first.

    Thread Starter shashikant91

    (@shashikant91)

    I have closed the window and tried reopening my databases & phpmyadmin

    Below is the error shown

    The MySQL server is currently offline.

    Error while connecting to MySQL: (XID asxzp8) The system failed to connect to the “MySQL” database “mysql” because of an error: 1040 (Too many connections) Error while connecting to MySQL: (XID asxzp8) The system failed to connect to the “MySQL” database “mysql” because of an error: 1040 (Too many connections) at /usr/local/cpanel/Cpanel/Mysql/Basic.pm line 391, <STDIN> line 1.

Viewing 15 replies - 1 through 15 (of 29 total)
  • The topic ‘Database connection error’ is closed to new replies.