Title: WordPress database error &#8211; Can&#8217;t select global_w &#8211; \nArray
Last modified: January 23, 2018

---

# WordPress database error – Can’t select global_w – \nArray

 *  [Hades666](https://wordpress.org/support/users/bradhowe/)
 * (@bradhowe)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/wordpress-database-error-cant-select-global_w-narray/)
 * Hi Ron,
 * You help in the past with the upgrade and was hoping you could here too. We see
   to be getting more apache errors not and MySQL crashes do to the plugin failing
   on some query validation.
 * We are using the last version you gave us that was mysqlcli compliant.
 * Any ideas?
    —- [Sat Dec 23 22:09:39.612249 2017] [php7:notice] [pid 5075:tid 
   140458800797440] [client a.b.c.d:55934] WordPress database error 2017-12-23 22:
   09:39 Can’t select global [;
 * _w – \nArray\n(\n [referrer] => a.b.c.d/\n [host] => localhost\n [error] => \
   n [errno] => \n [tcp_responsive] => \n)\n for query made by require(‘wp-blog-
   header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’), require_once(‘
   wp-settings.php’), require(‘wp-includes/ms-settings.php’), ms_load_current_site_and_network,
   get_site_by_path, get_sites, WP_Site_Query->query, WP_Site_Query->get_sites, 
   WP_Site_Query->get_site_ids, SharDB->_real_escape, SharDB->db_connect
    [Sun Dec
   24 02:02:02.076650 2017] [php7:notice] [pid 5076:tid 140458709739264] [client
   f.s.r.d:55450] WordPress database error 2017-12-24 02:02:02 Can’t select global_w–\
   nArray\n(\n [referrer] => a.b.c.d/\n [host] => localhost\n [error] => \n [errno]
   => \n [tcp_responsive] => \n)\n for query made by require(‘wp-blog-header.php’),
   require_once(‘wp-load.php’), require_once(‘wp-config.php’), require_once(‘wp-
   settings.php’), require(‘wp-includes/ms-settings.php’), ms_load_current_site_and_network,
   get_site_by_path, get_sites, WP_Site_Query->query, WP_Site_Query->get_sites, 
   WP_Site_Query->get_site_ids, SharDB->_real_escape, SharDB->db_connect- —–

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

 *  Plugin Author [Ron Rennick](https://wordpress.org/support/users/wpmuguru/)
 * (@wpmuguru)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/wordpress-database-error-cant-select-global_w-narray/#post-9895644)
 * You get the `Can’t select {DB name}` after 4 mysql connection attempts (with 
   short pauses between attempts) failures.
 * Last year I had a server running a service that had a memory leak. Depending 
   on traffic/load sometimes the memory leak would exhaust memory. Once that happened
   MySQL connections failed.
 * Can you fill me in a bit on what your server set up is? Do you have access to
   server performance info, changing service logging config, etc. ?
 *  Thread Starter [Hades666](https://wordpress.org/support/users/bradhowe/)
 * (@bradhowe)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/wordpress-database-error-cant-select-global_w-narray/#post-9895694)
 * Hi Ron,
 * Yes, I have full admin access. I thought memory as well but not seeing any exhaustion
   or issues.
 * Apache/2.4.25 (Unix)
    php 7.1 centos 7
 * 4 vcpu
    12 GB Memory
 *  total used free shared buff/cache available
    Mem: 11854 9212 169 73 2472 2061
   Swap: 6143 52 6091
 * -=————-
    [Tue Jan 23 23:01:37.745938 2018] [php7:notice] [pid 5474:tid 140423436510976][
   client a.b.c.d:52352] WordPress database error Table ‘wp_global.wp_517_options’
   doesn’t exist for query DELETE a, b FROM wp_517_options a, wp_517_options b\n\
   t\t\tWHERE a.option_name LIKE ‘\\\\_transient\\\\_%’\n\t\t\tAND a.option_name
   NOT LIKE ‘\\\\_transient\\\\_timeout\\\\_%’\n\t\t\tAND b.option_name = CONCAT(‘
   _transient_timeout_’, SUBSTRING( a.option_name, 12 ) )\n\t\t\tAND b.option_value
   < 1516748497 made by do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters,
   delete_expired_transients, SharDB->query, referer: [https://domainsite.com/msoas/wp-cron.php?doing_wp_cron=1516748496.2691760063171386718750](https://domainsite.com/msoas/wp-cron.php?doing_wp_cron=1516748496.2691760063171386718750)[
   Tue Jan 23 23:07:03.943516 2018] [php7:notice] [pid 5474:tid 140423301404416][
   client a.b.c.d:37772] WordPress database error Table ‘wp_global.wp_6352_options’
   doesn’t exist for query DELETE a, b FROM wp_6352_options a, wp_6352_options b\
   n\t\t\tWHERE a.option_name LIKE ‘\\\\_transient\\\\_%’\n\t\t\tAND a.option_name
   NOT LIKE ‘\\\\_transient\\\\_timeout\\\\_%’\n\t\t\tAND b.option_name = CONCAT(‘
   _transient_timeout_’, SUBSTRING( a.option_name, 12 ) )\n\t\t\tAND b.option_value
   < 1516748823 made by do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters,
   delete_expired_transients, SharDB->query, referer: [https://domainsite.com/dl08/wp-cron.php?doing_wp_cron=1516748821.6258649826049804687500](https://domainsite.com/dl08/wp-cron.php?doing_wp_cron=1516748821.6258649826049804687500)[
   Tue Jan 23 23:25:05.504554 2018] [php7:notice] [pid 31715:tid 140423251048192][
   client a.b.c.d:47492] WordPress database error Table ‘wp_global.wp_874_options’
   doesn’t exist for query DELETE a, b FROM wp_874_options a, wp_874_options b\n\
   t\t\tWHERE a.option_name LIKE ‘\\\\_transient\\\\_%’\n\t\t\tAND a.option_name
   NOT LIKE ‘\\\\_transient\\\\_timeout\\\\_%’\n\t\t\tAND b.option_name = CONCAT(‘
   _transient_timeout_’, SUBSTRING( a.option_name, 12 ) )\n\t\t\tAND b.option_value
   < 1516749905 made by do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters,
   delete_expired_transients, SharDB->query, referer: [https://domainsite.com/wno/wp-cron.php?doing_wp_cron=1516749904.6637029647827148437500](https://domainsite.com/wno/wp-cron.php?doing_wp_cron=1516749904.6637029647827148437500)[
   Tue Jan 23 23:33:58.205146 2018] [php7:notice] [pid 5474:tid 140423436510976][
   client a.b.c.d:52902] WordPress database error Table ‘wp_global.wp_2103_options’
   doesn’t exist for query DELETE a, b FROM wp_2103_options a, wp_2103_options b\
   n\t\t\tWHERE a.option_name LIKE ‘\\\\_transient\\\\_%’\n\t\t\tAND a.option_name
   NOT LIKE ‘\\\\_transient\\\\_timeout\\\\_%’\n\t\t\tAND b.option_name = CONCAT(‘
   _transient_timeout_’, SUBSTRING( a.option_name, 12 ) )\n\t\t\tAND b.option_value
   < 1516750438 made by do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters,
   delete_expired_transients, SharDB->query, referer: [https://domainsite.com/mham/wp-cron.php?doing_wp_cron=1516750437.2623279094696044921875](https://domainsite.com/mham/wp-cron.php?doing_wp_cron=1516750437.2623279094696044921875)[
   Tue Jan 23 23:35:24.693670 2018] [php7:notice] [pid 5474:tid 140423234262784][
   client a.b.c.d:35080] WordPress database error Table ‘wp_global.wp_6332_options’
   doesn’t exist for query DELETE a, b FROM wp_6332_options a, wp_6332_options b\
   n\t\t\tWHERE a.option_name LIKE ‘\\\\_transient\\\\_%’\n\t\t\tAND a.option_name
   NOT LIKE ‘\\\\_transient\\\\_timeout\\\\_%’\n\t\t\tAND b.option_name = CONCAT(‘
   _transient_timeout_’, SUBSTRING( a.option_name, 12 ) )\n\t\t\tAND b.option_value
   < 1516750524 made by do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters,
   delete_expired_transients, SharDB->query, referer: [https://domainsite.com/ader228/wp-cron.php?doing_wp_cron=1516750523.3029251098632812500000](https://domainsite.com/ader228/wp-cron.php?doing_wp_cron=1516750523.3029251098632812500000)[
   Tue Jan 23 23:40:31.000762 2018] [php7:notice] [pid 5474:tid 140423343367936][
   client a.b.c.d:37718] WordPress database error Table ‘wp_global.wp_6355_options’
   doesn’t exist for query DELETE a, b FROM wp_6355_options a, wp_6355_options b\
   n\t\t\tWHERE a.option_name LIKE ‘\\\\_transient\\\\_%’\n\t\t\tAND a.option_name
   NOT LIKE ‘\\\\_transient\\\\_timeout\\\\_%’\n\t\t\tAND b.option_name = CONCAT(‘
   _transient_timeout_’, SUBSTRING( a.option_name, 12 ) )\n\t\t\tAND b.option_value
   < 1516750830 made by do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters,
   delete_expired_transients, SharDB->query, referer: [https://domainsite.com/g169/wp-cron.php?doing_wp_cron=1516750829.8285520076751708984375](https://domainsite.com/g169/wp-cron.php?doing_wp_cron=1516750829.8285520076751708984375)[
   Tue Jan 23 23:41:28.805988 2018] [php7:notice] [pid 5474:tid 140423293011712][
   client a.b.c.d:45300] WordPress database error Table ‘wp_global.wp_6350_options’
   doesn’t exist for query DELETE a, b FROM wp_6350_options a, wp_6350_options b\
   n\t\t\tWHERE a.option_name LIKE ‘\\\\_transient\\\\_%’\n\t\t\tAND a.option_name
   NOT LIKE ‘\\\\_transient\\\\_timeout\\\\_%’\n\t\t\tAND b.option_name = CONCAT(‘
   _transient_timeout_’, SUBSTRING( a.option_name, 12 ) )\n\t\t\tAND b.option_value
   < 1516750888 made by do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters,
   delete_expired_transients, SharDB->query, referer: [https://domainsite.com/mattiasdus5/wp-cron.php?doing_wp_cron=1516750887.8417179584503173828125](https://domainsite.com/mattiasdus5/wp-cron.php?doing_wp_cron=1516750887.8417179584503173828125)
 *  Plugin Author [Ron Rennick](https://wordpress.org/support/users/wpmuguru/)
 * (@wpmuguru)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/wordpress-database-error-cant-select-global_w-narray/#post-9900193)
 * Can you check your MySQL config file & see what the values are for
    - key_buffer_size
    - query_cache_size
    - max_connections
 * Can you search your plugins to see if you can find the string `DELETE a, b FROM`?
   Since that’s running in cron it could be happening often enough at some times
   to interfere with other threads.
 *  [silsbyc](https://wordpress.org/support/users/silsbyc/)
 * (@silsbyc)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/wordpress-database-error-cant-select-global_w-narray/#post-10210120)
 * We are seeing the same error on our installation.
 * Does it matter that Options tables like wp_global.wp_517_options really don’t
   exist? It isn’t just the timeout, but the site options tables are under the sharded
   prefix? So, for example, wp_f4.wp_517_options exists, but wp_global.wp_517_options
   does not.
 *  [silsbyc](https://wordpress.org/support/users/silsbyc/)
 * (@silsbyc)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/wordpress-database-error-cant-select-global_w-narray/#post-10210413)
 * Just to clarify, meaning the error about trying to delete transients during cron
   jobs, like: WordPress database error Table ‘wp_global.wp_517_options’ doesn’t
   exist for query DELETE a, b FROM wp_517_options a, wp_517_options b\n\t\t\tWHERE
   a.option_name LIKE ‘\\\\_transient\\\\_%’\n\t\t\tAND a.option_name NOT LIKE ‘\\\\
   _transient\\\\_timeout\\\\_%’\n\t\t\tAND b.option_name = CONCAT( ‘_transient_timeout_’,
   SUBSTRING( a.option_name, 12 ) )\n\t\t\tAND b.option_value < 1516748497 made 
   by do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters, delete_expired_transients,
   SharDB->query
 *  [silsbyc](https://wordpress.org/support/users/silsbyc/)
 * (@silsbyc)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/wordpress-database-error-cant-select-global_w-narray/#post-10225759)
 * (Let me know if I should move this to a new thread)
 * So it looks like the [delete_expired_transients function](https://developer.wordpress.org/reference/functions/delete_expired_transients/)
   was added in WordPress 4.9.
 * But not sure why it isn’t returning the correct SharDB database and instead looking
   under wp_global.

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

The topic ‘WordPress database error – Can’t select global_w – \nArray’ is closed
to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/shardb.svg)
 * [SharDB](https://wordpress.org/plugins/shardb/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shardb/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shardb/)
 * [Active Topics](https://wordpress.org/support/plugin/shardb/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shardb/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shardb/reviews/)

 * 6 replies
 * 3 participants
 * Last reply from: [silsbyc](https://wordpress.org/support/users/silsbyc/)
 * Last activity: [8 years, 1 month ago](https://wordpress.org/support/topic/wordpress-database-error-cant-select-global_w-narray/#post-10225759)
 * Status: not resolved