Questions tagged [mysql]

MySQL is an open-source, relational database management system.

525 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4 votes
1 answer
700 views

How can I list only sites that use a particular theme or plugin?

I need to search through dozens of WordPress multisite (network enabled) installs for sites that use a particular plugin. How can I list only sites that use a particular theme or plugin, preferably ...
iroast's user avatar
  • 41
3 votes
1 answer
2k views

Too many datadabse connections - upper ceiling mysql

We run a high traffic blog with around 500 real-time users and 10000 posts. We are hosted by self on VPS - 16gb, 4 core with separate mysql DB server - 4gb, 2 core; both SSD. No problem with hosting ...
edtamil's user avatar
  • 31
3 votes
1 answer
818 views

$wpdb->get_results() does not fetch results with unicode 'WHERE' clause

I've just a simple query to fetch a students records by his name, written in Bengali. $student_rcrd = $wpdb->get_results("SELECT * FROM student WHERE name='আবুল কালাম আজাদ'"); Although my database ...
Tajin Ahmed Nipun's user avatar
3 votes
1 answer
6k views

Error: MySQL shutdown unexpectedly. XAMPP local conf running WordPress

I have a xampp configurated locally to run wordpress. I must have done something wrong when fixing some issues 'cuz at the end, I got stuck with the following log from mysql database. 2015-11-10 15:...
Alin Andrei's user avatar
3 votes
0 answers
874 views

Emojis getting converted to "?"

Emojis in posts and comments on a 500+ posts blog get converted automatically into single question marks in irregular and untraceable intervals. The respective tables wp_comments and wp_posts are ...
Jörg Mayer's user avatar
3 votes
0 answers
357 views

Is the usage of ON DELETE CASCADE wrong or not allowed on wordpress?

I have table with foreign key reference and i recently changed the create table query with ON DELETE CASCADE $wpdb->query("DROP TABLE IF EXISTS $table_name2"); //CREATE TABLE ...
Abhilash Narayan's user avatar
3 votes
0 answers
2k views

Database with mixed collation (utf8mb4 & utf8_general_ci)

Each time I was uploading my WP install from offline to online, I was noticing strange characters in text and digging a bit I have discovered that wp-config.php on the online server was set to define('...
Riccardo's user avatar
  • 951
3 votes
3 answers
18k views

What causes the "max_user_connections" warning on WordPress frontend?

I'm currently getting this error in the front-end only (not inside /wp-admin): Warning: mysqli_real_connect(): (HY000/1203): User xxx already has more than 'max_user_connections' active connections in ...
Ramnath's user avatar
  • 131
3 votes
0 answers
2k views

Wordpress Deadlock Error

I see more of this error these days in error_log. I see that someone asked this question here a year ago but no solution. Please advise what is causing this issue. Already, tried deactivating some ...
JDesigns's user avatar
  • 131
3 votes
0 answers
369 views

How to let a user choose an authors and save it to the database?

I have a multi-author Wordpress site which reads different rss feeds and posts them to my page. I was wondering if it is possible to make a code that would provide an opportunity to registered user ...
kissatkoiria's user avatar
3 votes
1 answer
2k views

How to merge local and live databases?

We've been developing for Wordpress for several years and whilst our workflow has been upgraded at several points there's one thing that we've never solved... merging a local Wordpress database with a ...
Rob's user avatar
  • 1,406
3 votes
1 answer
1k views

How to track a users progress through pages by inserting data into Wordpress Database?

My website users can learn British Sign Language through Video Tuts, Quizzes and games etc. I would like to track the users progress through the pages of the course and add that data to a Wordpress ...
samfrommadesimple's user avatar
2 votes
0 answers
146 views

Version upgrade: can my plugin filter the SQL statements issued during a database upgrade?

Background: I have a plugin with the purpose of changing up the indexes on some of WordPress's tables to make them more efficient for large sites. The plugin changes some primary and other keys for ...
O. Jones's user avatar
  • 471
2 votes
0 answers
200 views

Is MariaDB's Aria storage engine suitable for WordPress?

MySQL sites are steadily migrating away from the older MyISAM storage engine to InnoDB. That's because InnoDB has better recovery and row-by-row transaction locking support. At the same time, many ...
O. Jones's user avatar
  • 471
2 votes
0 answers
153 views

Wordpress Ajax Custom Query - High CPU LOAD

I'm developing a fully AJAX community WP theme that comes with a lot of custom queries. Everything is fine, there is no bug but recently but I had a few client that have a huge database and my theme ...
techn9ne's user avatar
2 votes
0 answers
2k views

Is it safe to convert tables from MyISAM to InnoDB?

I have inherited a WP site (with WP5.1 and WooCommerce 2.6.14, LearnDash 2.5.4 and few other smaller plugins). From screenshot you can see that it is a mix and match of MyISAM and InnoDB tables. ...
Dimitry K's user avatar
  • 121
2 votes
1 answer
2k views

How to delete all customer user account that haven't placed a single order?

Recently I've had an influx of spam users registering on my Wordpress website and I am trying to delete them all if: they have a "Customer" role haven't placed at least one order before As I could ...
ignite-me's user avatar
  • 121
2 votes
0 answers
111 views

Keeping database within limits, please help!

I have a website that auto generates odds data to mysql table via cron job every 2hrs. Over time the data in my table is exceeding the limit set from my hosting of 100mb. I want to stop my table from ...
Kevin's user avatar
  • 21
2 votes
0 answers
57 views

How to delete posts that does not have a thumbnail?

I have a problem with my blog. The thing is this, all the posts have a thumbnail in this address: wpbv_postmeta-->meta_key-->thumb And several (A LOT) of posts don't work, because I have made a ...
Amado C Ch's user avatar
2 votes
0 answers
1k views

Find duplicate posts with same slug and author

We imported over 250K posts into our multi-author WordPress database but have found duplicate posts where the same author has multiple posts with the same slug. Could you please recommend a MySQL ...
HBCondo's user avatar
  • 153
2 votes
0 answers
46 views

Get the Plugin Which Triggered a MySql Query in Wordpress?

I am currently working on this plugin, which is similar to Query Monitor in which i Have displayed all the Details present in the $wpdb object. Now i need to find which plugin is Triggering the Query. ...
Akash Manhas's user avatar
2 votes
1 answer
474 views

AJAX in Wordpress, sending coords data to MySQL and show after into map

I've spent some months trying to figure out how to get users geolocation and pass it into MySQL and so after being shown with markers on the map. I've got stuck already in passing the data through ...
Caesar's user avatar
  • 25
2 votes
1 answer
2k views

Wp query show post by author name or post title or post content

I have to create a search query which allows me to filter all posts where author name and post titles or post content has the word from search textbox. So if i search wordpress it should list all the ...
star's user avatar
  • 31
2 votes
2 answers
603 views

Converting mysql to $wpdb

I'm trying to convert this to using a $wpdb class. It will return all the enums possible and i have to use this $wpdb due to mysql_query giving me weird error (no database selected) Code is following ...
Egert Aia's user avatar
  • 121
2 votes
1 answer
80 views

How to migrate the posts from an old custom legacy blog to a new WordPress website?

I have to migrate the posts of a very old custom legacy blog made in ASP (the posts are stored in a MySql table) into a new WordPress blog. So I need your help to find the smartest solution to do it, ...
AndreaNobili's user avatar
2 votes
0 answers
2k views

Slow meta_query with about 4 milion record on wp_postmeta

Although optimized wordpress all the way but still very slow as follows : I have converted from LONGTEXT meta_value field to TEXT Then create INDEX for this field ALTER TABLE wp_postmeta ADD INDEX ...
quyet's user avatar
  • 65
2 votes
0 answers
221 views

How can I make wordpress suppress mysql errors?

Wordpress has two functions related to SQL queries and their errors as mentioned in What Is The Difference Between suppress_errors() And hide_errors() in $wpdb? From what I've read setting WP_DEBUG ...
cwd's user avatar
  • 1,862
1 vote
1 answer
19 views

Deleting WordPress posts and media files based on author via MYSQL database

I would like to delete some of the posts in WordPress between a period based on the author via MYSQL database. I have difficulty identifying the WordPress tables and their relationships to perform the ...
Lal Prasanth's user avatar
1 vote
0 answers
32 views

How to properly prepare a column name if passed to a stored procedure?

I've figured out that I can use %i with $wpd->prepare() to escape identifiers like column names. The thing is that the query I'm preparing is a call to a stored procedure like this. I want the end ...
Compjeuter's user avatar
1 vote
0 answers
61 views

How connection pooling can be implemented in Wordpress?

I have been facing issues with High connection count on mysql DB and therefore suggested to have connection pooling implementation. I did a lot of research but finding solution for different tech like ...
Prashant Dubey's user avatar
1 vote
0 answers
68 views

Split Million WordPress Post's Into Multiple Database Server

Say I have 50,000 posts in my current WordPress installation. May be it will grow more than 5,00,000 post's in the future. Now I wanna Scale the database. I wanna put , 1-50,000 posts > database ...
damagebrain's user avatar
1 vote
0 answers
146 views

Using hook to use DISTINCT in a wp_query

SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) INNER JOIN wp_product dg ON dg.post_id = wp_posts.ID AND ( dg.location IN ('XV', ...
Sayaman's user avatar
  • 135
1 vote
0 answers
152 views

Creating mySQL procedure with $wpdb

I'm trying to create a calendar table upon activation of a custom plugin I am building. The procedure script I am using can be seen here: https://gist.github.com/bryhal/4129042 The first part that ...
James Walshe's user avatar
1 vote
1 answer
609 views

mysqli_sql_exception: Unknown column 'wp_' in 'field list' PHP 8

I cannot install latest wordpress at xampp
Muhammad Muazzam's user avatar
1 vote
0 answers
1k views

How can I fix WordPress installation errors?

I download Wordpress version 5.8.3 (PHP version 8.1.1 & MySql version 8.0.27). When I want to install Wordpress, when input database data (databasename, username, password and ...) and click ...
Robin So's user avatar
1 vote
0 answers
28 views

Bulk create clean user_nicename from user_email with SQL function

All user_nicenames were replaced with a domain name in botched import. I'm trying to recreate them from the user_email filed but need them cleaned of all special characters ("@" and ".&...
Kurtis Amundson's user avatar
1 vote
0 answers
64 views

Control panel loads slowly due to 2 slow queries on comment table

Our WP site’s control panel loads very slowly. Analyzing this with the Query Monitor plugin, I see that it is slowed down by two queries, both on the comment table. First one: SELECT comment_approved, ...
dsaada's user avatar
  • 11
1 vote
0 answers
72 views

SQL Injection blocked by firewall

I have a WordPress site that is guarded by firewall. Today I got a notification of blocked SQL injection. I cannot understand what the hacker is trying to do with the query: https://example.com/?p=121%...
Tony's user avatar
  • 111
1 vote
0 answers
639 views

pagination with 'no_found_rows' => true,

I have 100000 records in my database and so many meta query performed on it so it takes lot of time to perform the operation, have checked few articles and using them it suggest disable no_rows_found ...
user2532600's user avatar
1 vote
0 answers
129 views

Dynamic dropdown from database table

I need a little help: I want to create a drop-down populated by mysql database table with two options: Select option 1 (regions) Select option 2 (schools) Where in option 2 appears populated according ...
Kai's user avatar
  • 21
1 vote
0 answers
566 views

How to display data from custom table in wordpress phpmyadmin

Thanks in advance could anyone here help me, I would like to display the value from the phpmyadmin database in wordpress, The value was stored from the dropdown form and I want display that value in ...
Siddheshwar Chavan's user avatar
1 vote
0 answers
19 views

Calculating a large number of MYSQL queries as customshort codes, slow

I am using wordpress and building a dashboard. There are a lot of complex MYSQL queries that I am running in order to return results from the DB. I am returning these as custom short codes in ...
Mikey's user avatar
  • 11
1 vote
1 answer
223 views

Improve performance by removing unnecessary database queries

I've just found out that main page of custom theme im developing does 150 db queries on every load (what takes even 2.5 seconds). Many of them come from functions.php, and are caused by for example ...
user avatar
1 vote
0 answers
38 views

C# user_nicename and Display name blank

I'm writing a C# application to add subscribers to wordpress. The problem I'm having is the user_nicename and display_name fields in the database are showing but in the WordPress Users interface the ...
noobInTraining's user avatar
1 vote
3 answers
5k views

Huge wp_options table

I have a problem on a WP site. Website crashes because there is no more available disk space. Searching, i detect that wp_options table size is 12GB, but only have 1100 rows aprox: Any ideas? Thanks ...
50l3r's user avatar
  • 131
1 vote
2 answers
3k views

Redirecting to old domain after migration website

Could someone help me with restoring my website (with new domain name)? I have a database backup and when restore it, wordpress is redirecting me to old website and domain. I changed site url in mysql ...
Dejana Popovic's user avatar
1 vote
1 answer
595 views

Can I restart MySQL engine when WordPress website is live?

I'm dealing with resources processes problems in MySQL engine installed on an Ubuntu server, which hosts a WordPress website. So, I want to try restarting the service, will using the service mysql ...
mhweb's user avatar
  • 65
1 vote
0 answers
43 views

Woocommerce PHP site that shows table with orders from specific category

i want to make a PHP site for each of my deliverer that shows orders for them, im using querry like this to show orders: select p.ID as order_id, p.post_date, max( CASE WHEN pm.meta_key =...
Adrian's user avatar
  • 11
1 vote
0 answers
122 views

WpDataTables - View Image Directory

I made a form in PHP and it has an image upload that returns the image name in MySQL, and in the Wp-admin / wordpress folder. It is functional, so I created a column with URL Link in DataTables to ...
Gabriel Menegueli's user avatar
1 vote
0 answers
428 views

WP_Query adds "(wp_posts.ID = '0')" so no results are returned

I am doing a very simple WP_Query: $query = new WP_Query([ 'pagename' => 'some-post-slug', 'suppress_filters' => true // used by WPML to search in ANY language ]); However, the ...
FooBar's user avatar
  • 444

1
2 3 4 5
11