Questions tagged [wordpress]

For questions about databases behind WordPress, a content management system based on PHP. General questions about WordPress are off-topic but might be welcomed at WordPress Stack Exchange.

Filter by
Sorted by
Tagged with
13 votes
3 answers
40k views

Cache MySQL database in memory

I am having problems with a website with 600MB of MySQL database. The website is way too slow. I noticed the bigger the MySQL database gets, the slower it goes. When it was 5MB, the website was very ...
grant tailor's user avatar
3 votes
1 answer
2k views

Wordpress using varchar(255) for index with InnoDB and utf8mb4_unicode_ci?

I'm trying to learn a bit more about the details of proper database construction and ran across something that confuses me. In a current Wordpress installation, I'm finding varchar fields used for ...
David Rahrer's user avatar
3 votes
2 answers
1k views

Error Referencing wp_users as Foreign Key

I'm fairly new to SQL. I'm trying to create a FK for one of my tables (time_sheet) to one of the Wordpress tables (wp_users). But I'm hitting an error and I'm not entirely sure why that is. This is ...
Radizzt's user avatar
  • 31
3 votes
1 answer
1k views

MySQL 5.5 vs 5.6,5.7 above same database same query but different output, limit have duplicated ID

I am using Running same source code and same database for WordPress, only the mysql version is different. It make my pagination post have duplication. Here is what I found out. Any idea how to solve ...
Shiro's user avatar
  • 153
3 votes
2 answers
7k views

How to fix MySQL high CPU usage running on VPS

I manage a WordPress site on virtual private server with 2 vCore, 80GB SSD, 4GB of memory, Ubuntu 18.04, Apache 2.4.29, and mysql community version 8.0.20. When started the site on the server, ...
mhweb's user avatar
  • 63
3 votes
2 answers
3k views

MySQL hundreds of sleep processes giving "Error establishing a database connection" error

I'm running a LAMP with ubuntu server 12, mysql innodb_version 5.5.49 on a Wordpress platform (3 websites virtualized). Has been running without issue for about 2 years, but I just started getting an ...
user255406's user avatar
3 votes
1 answer
896 views

MySQL very long-running queries

I have a quite large db (800+Mb dump file) that I imported to my local server. It's a Wordpress db from witch I need to extract certain posts. There are around 160,000 posts inside. Currently I'm ...
klo's user avatar
  • 31
2 votes
2 answers
280 views

Select the maximum aggregate value for a limited set of chunked/grouped rows in a large database?

I work on WordPress plugin which implements sitemap functionality. One of the steps is to build an index of sitemap pages for post entries. The logic required is roughly: determine last modified time ...
Rarst's user avatar
  • 123
2 votes
2 answers
846 views

Migrate SQL Server backup to MySQL for a Wordpress site

I have a client with an old .Net site that used SQL Server. For lots of reasons they decided to switch to Wordpress. They had a bunch of news articles on that old site that they want turned into posts ...
Bs3kg's user avatar
  • 23
2 votes
1 answer
268 views

Is it normal that our Wordpress' database crashed multiple times in this month alone?

I just started a new job at a small magazine as an IT guy. It all worked fine, but I'm worried about some issues with our VPS installation. Since I started working here (26 days ago), our Wordpress' ...
sudo --do-it's user avatar
2 votes
1 answer
1k views

WordPress with massive MySQL database slow. Would MySQL replication help?

Database Administration is usually not my strength, but one friend asked me if I can help him with his project. He is running a WordPress (MySQL) website with WooCommerce. The postmeta table stores ...
Jan Rohweder's user avatar
2 votes
1 answer
279 views

Unexpected very slow user count in WordPress

I have a Wordpress page that returns timeout error every so often. When reviewing the MySQL "slow queries" log, I could notice that there is an extremely slow query coming from Wordpress, ...
Joseph's user avatar
  • 121
2 votes
1 answer
2k views

In a WordPress/WooCommerce table the prices are hosed. How to realign them? (a key=value structure)

We had in our WordPress/Woocommerce table (hence mySQL) ab_postmeta the sale (discount) prices for some products. We thought that reseting the sale prices via SQL query (and not via WordPress ...
John Thomas's user avatar
2 votes
1 answer
138 views

Join two SELECT results with the same post_id value

I need to do a query to the MySQL database of my site built in WordPress / WooCommerce. The 'wp_posts' table keeps products, articles and more. Every row in 'wp_posts' has a 'post_id' to connect '...
miganml's user avatar
  • 21
2 votes
1 answer
2k views

Error 134 in a MySql table

I have a file (mysql error file) full of this message [ERROR] Got error 134 when reading table './xxxx/wp_options' I don't really know how to fix this problem
Webmaster Peter's user avatar
2 votes
1 answer
6k views

Warning: mysqli_real_connect(): (HY000/2002): Connection refused in /var/www/html/wordpress/wp-includes/wp-db.php on line 1626

I'm just starting to code and I try to host a Wordpress website on a server of my school. However, as soon as I upload the website on the Wordpress interface with the plugin "all-in-one migration", ...
Clemm's user avatar
  • 21
2 votes
2 answers
364 views

How to increase performance with joins to create VIEW from Wordpress wp_usermeta [duplicate]

After a lot of searching, I finally was able to create a SQL Query to retrive Wordpress User Meta Data. Now the problem is, the performance is so bad it doesn't even show me a result after 30 min. ...
Patrick's user avatar
  • 23
2 votes
2 answers
3k views

Waiting for table level lock on wordpress site

We are experiencing issues with mySQL loading 100% of the server's CPU. While checking the running processes we found many of the following: Waiting for table level lock | SELECT option_name, ...
silverscales's user avatar
1 vote
1 answer
573 views

How to avoid DROP TABLE for a specific MySQL table

I have used a Wordpress plugin that for some unknown reason is always deleting a database table (cerber_files). The plugin's author is not giving support for this issue. I think in order to solve ...
Rogério Dec's user avatar
1 vote
1 answer
522 views

Dedicated tables VS Multipurpose Tables

I am developing a forum like app using a MySQL database. I have posts, comments and replies just any other forum. At the moment I have a table for posts, a table for comments/replies and a table for ...
Marios Frixou's user avatar
1 vote
3 answers
705 views

WordPress MYSQL DB BINARY LOG - Droplet/SERVER Volume Increasing rapidly

My WordPress website uses Nginx. Recently I have noticed that server volume has increased from 8GB to 40GB. I have found that the WordPress MYSQL Binary Log is taking more space. Each second, database ...
 Ibrahim EL-Sanosi's user avatar
1 vote
1 answer
682 views

Wordpress crash on slow queries related to wp_term and wp_term_taxonomy

I have a WordPress blog with around 90K articles. The problem is I get frequent crashes on the server and browsing is slow due to some slow queries on the website. I am suspecting the problem is with ...
user avatar
1 vote
2 answers
1k views

After changing engine from myisam to innodb tables are larger in size, is this an expected behaviour?

I updated a WordPress database from myisam to innodb on a server using apache and mysql, and I noticed that some tables, such as wp-posts grew in size after running the ALTER TABLE wp_posts ENGINE=...
mhweb's user avatar
  • 63
1 vote
1 answer
929 views

MySQL server keeps crashing every few minutes

I am having the hardest time tracking down this problem. Every few minutes or so my database server crashes so all 3 WordPress sites on my WHM cPanels all crash at the same time. When it does, I get ...
Okomikeruko's user avatar
1 vote
2 answers
3k views

Temporary tables created on disk: is huge

I have an issue with a huge number of Temp tables writing on disk. I have tried many things to avoid this but no luck and I really am giving up. I though I might need some expertise to help solve this ...
kashalo's user avatar
  • 111
1 vote
1 answer
135 views

Counting Number of Database Connections on a Page

I have a LAMP stack(mysql and php) wordpress site and I want to know the number of database connections opened when a page loads. I can find other numbers but I can't figure out the number for a ...
blueseal's user avatar
  • 125
1 vote
1 answer
2k views

Optimise MySQL on VPS (2 CPUs & 3 GB RAM) with WP MU

I have a vps server with os centos 6.7 64x, 2 cpu's and 3gb ram, and I use it exclusively for a WP MU (Memory limit: 512 MByte/Memory usage: 53.97 MByte). I use mostly myisam and have about 30 ...
Alex's user avatar
  • 43
1 vote
2 answers
1k views

wordpress site kills mysql

I move client wordpress sites from one VPS to another, it all went smooth until I moved a site that kills mysql (and, consequently, all other wp sites). It used to work fine on the previous VPS. Here'...
Mikhail Vasin's user avatar
1 vote
2 answers
2k views

join same table twice and get the results of rows

i have table like wp_term_relationships object_id term_taxonomy_id term_order 194 2 0 194 7 0 194 8 0 194 ...
Advanz Virtual Consultant's user avatar
1 vote
0 answers
113 views

Critically high website CPU usage very sudden, persistent upon reboots [closed]

Quick summary. Wordpress community website, large userbase. Has caching for guests (WP Super Cache). Always operates around load of 1-2, or 5-6 at peak hours CPU. As of 4pm EST on Feb 15, the CPU load ...
yesbutmaybeno's user avatar
1 vote
1 answer
170 views

Looking for some advice to complete custom mysql query against 3 different tables

I would like to create a query to populate a table dynamically by querying the 3 databases that contain relevant information about their entry. wp_gf_entry, wp_gf_entry_meta, and (ideally) with ...
Zoe's user avatar
  • 13
1 vote
1 answer
7k views

Wordpress causes high CPU usage (mysqld)

I have a wordpress site with 500k posts in MYSQL database running on debian dedicated server: Server OS: Debian 8 "Jesssie)" - Linux version 4.9.58-xxxx-std-ipv6-64 ([email protected]) (gcc ...
Martin Smith's user avatar
1 vote
3 answers
726 views

Mysql 5.5.45 crashing after refreshing web page rapidly(Too Many Connection warning)

I am using ec2 aws instance for my wordpress webiste.after every 5 to 10 minute and randomly my website going down i tried lots of things like increasing buffer memory ,memory limit but that not ...
Sanjay Nakate's user avatar
1 vote
0 answers
343 views

High load on server because of one query

I have one query running from last stable version of wordpress on causing high load on my centos 6.7 server I enabled slow query log thought /etc/my.cnf file to record which sql cause this problem ...
iLinux85's user avatar
  • 163
1 vote
1 answer
56 views

How to filter out the records with the latest date?

I have a table with id, task_id, created_taskaction (= rec.cr.date). I would like to get the latest record for e.g. task_id 0001. In the wordpress framework I tried this: > $last_task_action2=$...
mesqueeb's user avatar
  • 189
1 vote
1 answer
2k views

Speed up MariaDB?

I have a Wordpress Woocommerce store using WP All Import Pro to run automatic imports on a 15 minute cronjob schedule. It's usually trying to update 400 to 500 items from our supplier every 15 minutes....
Pop's user avatar
  • 13
0 votes
2 answers
61 views

Advice for database implementation [closed]

We need to configure a database for our NGO. We have to save information about the children and several pictures and documents for each of them. A friend is currently saving the data of over 70 kids ...
starryn1ght's user avatar
0 votes
2 answers
137 views

Error establishing a database connection

we have wordpress site & everyday we are getting below error : error establishing a database connection almost once i a day than we have to restart mysql to fix this.... var/log/mysql - error....
Baby in Database's user avatar
0 votes
1 answer
1k views

Help me understand and resolve MySQL deadlock - "lock mode AUTO-INC waiting"

I am experiencing an issue with MySQL deadlocks and here is what I see in the MySQL error log: 2017-07-24 09:09:29 7fd5235db700InnoDB: transactions deadlock detected, dumping detailed information. ...
Daniel Kanchev's user avatar
0 votes
1 answer
91 views

mySQL INNER JOIN and Conditions

I wrote a mySQL query that is just works as I need. SELECT COUNT(wp_posts.ID) as count, wp_terms.term_id FROM wp_terms INNER JOIN wp_term_taxonomy ON wp_term_taxonomy.term_id = wp_terms.term_id AND ...
techn9ne's user avatar
0 votes
1 answer
506 views

WordPress and WooCommerce very slow query

After a migration to a new WooCommerce install, but we are experiencing very sow queries. Sometimes more than 1 minte. Currently this query is fired. This is fired in 0.7253s EXPLAIN SELECT t.*, tt.*, ...
Wouter's user avatar
  • 1
0 votes
1 answer
59 views

Restoring a MySQL database

My Ubuntu 16.04 server was recently hacked and my host allowed me to recover the file system via FTP, closing all other ports thus disabling me from logging in and stopping any services. I have the ...
hatcat's user avatar
  • 101
0 votes
2 answers
1k views

mysql > why replace command is not working on strings coming from json encoded?

Say in my wordpress db I've got a post_content column containing strings like this: href=\"http:\/\/dev.example.com\/example\/wp-content\/uploads\/2019\/07\/my.pdf\" The above is a portion of string ...
Luca Reghellin's user avatar
0 votes
1 answer
67 views

MySQL: Can not add foreign key into create table statement

The queries below (assigned to php variables) seem to have an issue on the 2nd query, where I set the foreign key to the "couponId" column on the first table. My IDE lints "couponId" (inside the ...
Sean D's user avatar
  • 129
0 votes
1 answer
96 views

Mariadb times out on startup after system reboot

This is continued from: https://stackoverflow.com/q/55071021/8644833 Mariadb shuts down after running for a minute or two. If I remove Mariadb and reinstall (keeping my databases), everything works ...
Phillip Brantley's user avatar
0 votes
1 answer
477 views

How to use Unicode chars on PHPMyAdmin?

On a WordPress site I want to replace " !" and " ?" by " !" and " ?". The challenge is that the replacement string not uses a common space char but a thin space char (U+2009). PHPMyAdmin is used for ...
Toby's user avatar
  • 1
0 votes
1 answer
435 views

WordPress database error Table './databasename/wep_options' is marked as crashed and should be repaired for query

Please help me my mysql is keep crashing again and again and generating following error i am out of any clue what will be the reason for this issue WordPress database error Table './databasename/...
Shahid Hussain's user avatar
0 votes
1 answer
2k views

PostgreSQL to MySQL migration to use database for WordPress site - how to's?

I have a complex issue to solve, related to database migration. I have a website full of news to migrate that is currently based on a PostgreSQL database and written in PHP, without a CMS. I have a ...
query_question's user avatar
0 votes
1 answer
487 views

Performance penalty for using thousands of tables in MySQL

Background I'm using WordPress multisite in which each user will have a separate blog. For each blog, additional 15 tables are created. The website will be used by thousands of users. That means that ...
sakibmoon's user avatar
  • 103
0 votes
3 answers
203 views

Major performance difference from a small change in query

I have a query written out to search a WordPress database for any post ids that match the keyword search to post content, title, author, or associated company. The company portion of the query is ...
MooseBalm's user avatar
  • 101