Questions tagged [mysql]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
15 views

Updates applied to staging WordPress site affecting production even with different databases

I am experiencing strange database-related behaviours on my server that hosts a few versions of the same website. The problem relates to making content and theme updates to one of the subdomain sites ...
Mike Hermary's user avatar
0 votes
0 answers
8 views

Custom API how to return int field

I have a custom table in db with a column recommendation of type int(11). Then as one of my custom route handlers I have global $wpdb; $query = "SELECT recommendation FROM `restaurants`; // ...
Simon H's user avatar
  • 335
0 votes
1 answer
28 views

After Import: Insert "Use" Statement in Database

In transferring a site from one host to another while retaining the same domain name, copying WP files is straight-forward, not so with sql databases. In a shared hosting environment, importing a ...
Laurie Stearn's user avatar
0 votes
1 answer
25 views

Understanding Redundant postmeta Tables in WordPress Database

I have noticed that my WordPress database contains three identical postmeta tables. Each of these tables seems to hold the same information. Is it normal to have multiple postmeta tables in a ...
Diane Rendel's user avatar
0 votes
0 answers
22 views

Help with creating commenting system using PHP, jQuery and AJAX

I am working on creating a comment system for an events plugin I am working on. I've got the main comments working fine with them saving to the database and displaying on the page. What I need help ...
Darth Mikey D's user avatar
0 votes
0 answers
11 views

Product reviews in my sql database

Apparently product reviews section within woocommerce does not have any option to adjust the amount of reviews displayed per page under screen options? Unlike the products section. Is there a way to ...
Jason's user avatar
  • 1
0 votes
1 answer
67 views

#1067 - Invalid default value for 'post_date' when trying to create a new column

I am trying to create a new column inside the wp_posts table but I am getting the error #1067 - Invalid default value for 'post_date' when I try and save it. What I am trying to do is, I am getting ...
I. Antonov's user avatar
0 votes
0 answers
30 views

MySQL has died. How do I recover? SOLVED

Not sure if I'm asking this in the right place. If not the right place please suggest where I may ask this. I'm usually on stackoverflow. I noticed my websites could not communicate with mysql today. ...
Trev's user avatar
  • 101
2 votes
3 answers
57 views

WP Plugin: How to avoid db access for each comment?

I'm writing a WP plugin which enables voting for comments. To store the votes a custom db table wp_comment_vote is being used. CREATE TABLE wp_comment_vote ( comment_vote_id bigint(20) UNSIGNED ...
Abid's user avatar
  • 143
0 votes
0 answers
25 views

Updating wp_postmeta from meta_keys and meta_values from another table having price and sku only

UPDATE wp_postmeta pm INNER JOIN wp_postmeta as pm2 on pm.post_id = pm2.post_id SET pm.meta_value = 'price such as 45' WHERE pm.meta_key = '_price' AND pm2.meta_key = '_sku' AND pm2.meta_value = '...
Syed Bilal Ali's user avatar
0 votes
0 answers
21 views

Does Wordpress work with MySQL active-active GTID-Based Replication without any issues?

Does WordPress work with MySQL active-active GTID-Based Replication without any issues? Is it suitable for the production WordPress website? I would like to set up the same with WordPress 6.2.2 and ...
PJ DevOps's user avatar
0 votes
1 answer
17 views

Query custom fields with three dates - start and end does not work

I have tried to make a reservation system for a book a table in restaurant. But, I have a problem when I try to see/ make new reservations in an specific day - in showing me which table are free at ...
Fujitsu09's user avatar
0 votes
0 answers
151 views

WP-CLI PHP Deprecated Warning

Under WordPress 6.3, PHP 8.2, MySQL 8.0.34, WP-CLI 2.8.1, for wp command like this: wp post list --post__in=mypostid I have this warning: Deprecated: Creation of dynamic property Post_Command::$...
Brethlosze's user avatar
0 votes
0 answers
34 views

Import posts from a different database with the same old id

I am trying to retrieve data from an old custom programming to a new WordPress site, but I encountered a problem that I cannot retrieve the old id number. I need that to keep the site's archive, the ...
Kami's user avatar
  • 1
1 vote
0 answers
35 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
0 votes
1 answer
34 views

Multisite: merging two subsites in the main site

I have a multisite: example.com = example.com/ar/ example.com/es/ example.com/en/ example.com/ba/ I need to merge 2 and 4 into 1 the main site without losing the post Ending with only 2 webs: the main ...
Irene's user avatar
  • 23
0 votes
0 answers
28 views

Can not insert data in database table

I did a form and through a plugin i coded in php, i’d like to insert the result of this form into my wordpress database. But i run into a problem cause nothing is inserted in my database despite the ...
Louis-Emmanuel Metan's user avatar
-1 votes
1 answer
59 views

MariaDB version not recognised

Getting the following error on a CentOS 9 server: You cannot install because WordPress 6.0 requires MySQL version 5.0 or higher. You are running version . So it doesn't appear to be picking up the ...
SCMedia's user avatar
0 votes
0 answers
67 views

WordPress install on new server not recognising MariaDB version

Getting the following error on A CentOS server: You cannot install because WordPress 6.0 requires MySQL version 5.0 or higher. You are running version . So it doesn't appear to be picking up the ...
SCMedia's user avatar
0 votes
0 answers
52 views

Can't insert into a database wordpress

i did a form with html and js, and through a plugin in php, i wish i could insert the result of this form into my wordpress database. But i run into multiples problems. One was that wordpress would ...
Louis-Emmanuel Metan's user avatar
0 votes
2 answers
146 views

How to reduce uncached page generation time?

On uncached pages, I have been able to bring down database query timinings to less than 0.2 seconds with sql tuning. However, the page generation time is still around 2 seconds as seen below via query ...
dc09's user avatar
  • 195
0 votes
0 answers
75 views

Wordpress causes Mysql high memory

Recenty I deployed a wordpress multisite instance by helm chart to GKE. However, It causes increasing memory of mysql from 600MB to 2.6G usage. I try to use Percona to analyze the database, then see ...
PhanThanh's user avatar
0 votes
2 answers
116 views

How can I update a value of a field depending on outside source?

Say I have a text file or JSON file elsewhere on my domain, that have a simple value, like "yes" or "no". I would like to update a custom field in a database table in Wordpress (...
Malachi's user avatar
  • 101
0 votes
1 answer
189 views

running an existing Wordpress site from Visual Studio Code?

Perhaps I am being a bit thick on my research and haven't nailed what I have to do in order to achieve what I want to achieve so here's my question: I have an existing Wordpress site that has been ...
Jose's user avatar
  • 1
0 votes
0 answers
28 views

Putting form result in my database

i have a problem with my wordpress rn. I did a form in html and js, and i want to put the actual result in my database where i created a table for it. So basically i did a plugin in simple php that ...
Louis-Emmanuel Metan's user avatar
0 votes
0 answers
30 views

How to use Ajax with Wordpress

I am trying to pass a javascript over to a PHP variable by using AJAX. However, I am having a little bit of difficulty understanding Ajax, as I am new to it. Here is my code: <form method="...
John Lyons's user avatar
0 votes
0 answers
17 views

Export Woocomerce Image Product URL

Hi I am try to export with mysql url image of woocommerce. For export orders I using this method and that work perfect. select * from wp_posts where post_type like 'shop%' into outfile '/var/lib/mysql-...
kuribo's user avatar
  • 1
1 vote
1 answer
265 views

Batch Replace URLs in Wordpress Database

I will be using this command with WP-CLI to batch change about 1,000 URLs. while IFS=, read orig new; do wp --dry-run --skip-themes --skip-plugins search-replace "$orig" "$new" ...
JoaMika's user avatar
  • 668
0 votes
0 answers
19 views

WordPress issue - data is not showing in wp-admin, but when searching through database, all the data is there

I did a couple of plugin updates, and simple updates and it caused a site crash. I was able to deal with the plugin and get back into WP-Admin, but none of the data is there. No pages, events, ...
user231385's user avatar
0 votes
0 answers
6 views

How to find fresh (last modified) and sql backup?

I have 3 version of sql databases on my pc, i am again planing to upload it , but confused which was last database, any idea how to find last sql backup ?
Nisha_at_Behance's user avatar
0 votes
0 answers
29 views

Uploading to Wordpress Database

Hope everyone is doing great. I have a small issue with uploading information to the wordpress database. I created a new table without the prefix. I created code based on what I've learned in ...
Rookie Recruits's user avatar
0 votes
1 answer
80 views

Possible SQL injection. How to locate and fix?

Google Search Console is saying that certain suspicious URLs in my site are returning a 403 error. They look exactly like this (the links below are not my sites, just examples): https://www....
location's user avatar
0 votes
0 answers
15 views

what to do after instlling cyberpanel on VPS

I am upgrading from shared hosting to VPS hosting, so I went with digitalocean and used marketplace to create a droplet with cyberpanel, linked my domain to the droplet, moved data, and almost done. ...
mo999dev's user avatar
0 votes
0 answers
24 views

Have Wordpress Use a Different Database for users

I have imported my users from Filemaker into a different table in Mysql. Can I have my user login to that database instead of the wp_users table. If so how do I connect it? Thanks in advance for your ...
user3753328's user avatar
1 vote
0 answers
61 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
0 votes
0 answers
26 views

Bulk delete comments, foreach loop

I have a question about WordPress's wp_delete_comment() function. Let's assume I have an array that contains more than 3000 comments ID in it and I wanna remove all of them. First approuch would be ...
techn9ne's user avatar
0 votes
0 answers
186 views

Too much slow queries with my multisite

I have about 450 websites on a Wordpress 5 Multisite. The db is about 2GB with 8691 tables. My server is now very slow, I think because of mysql. I also saw many slow queries like this : # Query_time: ...
Sami's user avatar
  • 174
3 votes
1 answer
576 views

How to find source of these strange SQL queries?

I'm looking at my slow queries and i don't understand how some bot or person is doing them. They look like this: (i copy/paste them no placeholders!) SELECT post_id FROM wp_postmeta, wp_posts WHERE ID ...
Michael Rogers's user avatar
0 votes
0 answers
55 views

Can running a WP-Cron to update_post_meta cause performance issues?

I'm counting post views on a custom field inside wp_postmeta, the update happens each time a user interacts with the post. I was reading at this response Will a large postmeta table slow a site down? ...
Michael Rogers's user avatar
0 votes
0 answers
33 views

Menu problem : when add wordpress element in menu it convert into empty custom link

Problem comes after a migration of wp_posts table in SQL (import of this table from another database). When I add page in menu (Appearance -> menu) and click on save then it converts into custom ...
Sylvain's user avatar
0 votes
0 answers
127 views

Custom form that stores data in mysql database

Im currently building a website that allows a user to rent a boat rack but they need to be in the town in order to rent. I want to know how to create a form that allows the user to input their address ...
Logan's user avatar
  • 1
-1 votes
1 answer
79 views

wp_mail function not working in user query loop

I'm trying to send an e-mail to every user who is logged in more than a year ago (based on woocommerce meta value from database), but the e-mails do not go out. In my code I'm trying to filter myself ...
Attila Sotus's user avatar
0 votes
1 answer
113 views

MySQL query to list users who never signed in

What MySQL query can I use to get a list of users who have never logged in to WP? Some background... My WordPress website has been running since 2015 and initially, I had a newsletter form that would ...
Lazhar's user avatar
  • 183
0 votes
0 answers
55 views

Error resetting database index using ALTER TABLE in $wpdb->query

I'm running a Cron job every hour that clears all posts of a particular CPT and then re-inserts data by accessing a third party API. I'm worried that this will lead to huge indexes, so I would like to ...
clayRay's user avatar
  • 135
0 votes
0 answers
93 views

How can I delete the options from DB when the plugin is deleted?

I am saving my plugin's data under the wp_options tables. How can I delete my plugin's data and saved options from there when the user deletes my plugin? I know I can delete tables while plugin ...
Rajin Sharwar's user avatar
0 votes
1 answer
61 views

PHP Creating a formula from mysql db values and db stored math operator

I am trying to use variables stored in a DB and math operator (e.g. * + - /) to allow users to build formulas e.g. (Night Shift Hours*Night Shift Time Rate)*0.2 The formula string is build from ...
GURU mcewan.marriott's user avatar
0 votes
1 answer
428 views

Display total count of products in orders of a specific order status

I have an oddly specific challenge, displaying the total count of products in orders of a specific order status. So let's say there's 52 orders with the order status "Processing", I'm trying ...
King Live's user avatar
0 votes
1 answer
59 views

How to set variable to specific field when querying

I am trying to validate an input box against a field in a database. My question is, how does one check a single input equal to any field in a column? I am able to connect to my query, but am unable to ...
John Lyons's user avatar
0 votes
1 answer
350 views

How to get a database field value from a WordPress table? [closed]

I'm bumping my head against the wall here. I have searched here on SE and found several answers, but somehow they don't work for this scenario. I have WordPress + MemberPress and I need to retrieve ...
Maurice's user avatar
  • 25
0 votes
1 answer
218 views

Need SQL query to find&replace image URL

During a website move the wp-config.php file was replaced (by the host) to connect to the new database, and a directive I had in my old version (that specified a root folder for all images instead of ...
Trisha's user avatar
  • 418

1
2 3 4 5
32