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

learn more… | top users | synonyms

1
vote
1answer
923 views

Wordpress 3 - how are passwords stored and how do I compare to them?

For reasons I can't go into right now, I'm creating a form that will allow users to change their passwords for Wordpress by entering their current password and then entering the new password. I want ...
0
votes
1answer
530 views

latency problems with wordpress install (from SQL import)

I develop wordpress sites for a living, and today I am experiencing something that I haven't yet come across: Extremely slow load times / latency problems. You can view the site here: ...
0
votes
1answer
49 views

What's the sql for this condition?

I want to delete all records from wp_usermeta with user_id whose meta_value is "tonetone" which is spam accounts. As you know already, there are many records with one user_id in wp_usermeta. I tried ...
1
vote
1answer
679 views

Is it possible to split database tables using HyperDB?

I'm looking for an answer from someone who's implemented HyperDB or has knowledge of it. I have a database which has just passed the 100mb mark a week or so ago, the problem is my host only allows ...
0
votes
1answer
251 views

Only allow user to access a link once a year, based on their joining date

I am using Wordpress to run a membership site, and one of the features is that members can download a badge. However, they are only allowed to download the badge once per year, starting form the date ...
0
votes
2answers
1k views

MySQL: Possible to replace all of wp_posts.post_content(id#) via UPDATE + REPLACE + SELECT?

EDIT: I want to update one field (post_content) within a known record (id of 4) of a known table (wp_posts) in a new database (new_db). The update has to come from one field (post_content) within a ...
0
votes
1answer
376 views

Returning info from MYSQL table via custom taxonomy

Update: I'm now trying to find a way to echo the metadata of a custom taxonomy's value. I'm trying to create some PHP to use in a plaintext widget that'll display information in my sidebar. Because ...
5
votes
2answers
5k views

Checking if Database Table exists

I read the wordpress codex and professional wordpress. It seems both use something like if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) { to determine if the table exists. Is ...
1
vote
1answer
954 views

Call to undefined function get_user_meta() - trying to access data in MySQL from custom fields

I am trying to access data from some custom fileds in my MySQL db so that I can add them to a webpage that will be printed out. The data is held in a column called "paypal_user" and I need to access ...
1
vote
3answers
834 views

My WordPress site always displays a cached version of its homepage

First of all, sorry if I'm making a mistake. I already asked this on the ServerFault forum, but got no answers at the moment and I thought it would be a good idea to ask the question here, considering ...
2
votes
1answer
1k views

Split WP install between 2 databases?

Is it possible for Wordpress to work from two databases? The reason I ask is that we're approaching our 100mb limit for database size on our host (1and1) but have up to 100 databases, so what I was ...
0
votes
1answer
471 views

Wordpress and MySQL: trying to print data using PHP from user_meta custom field data

I have some custom user_meta fields in my MySQL database. The data is stored in my DB as follows: the meta_key is called "paypal_user" and the info is stored in the meta_value column as: ...
1
vote
1answer
435 views

Disallow categories from this MySQL query

I'm trying to modify a plugin that generates an archive listing so it shows only one category, making it a single category archive. The old version of the plugin used a get_posts query, and so it was ...
3
votes
1answer
625 views

Using source control with WordPress

I just recovered from a pretty bad crash using Server 2008 Shadow copy. Ultimatly I didn't lose more than a few hours of work but a loss is a loss. I've decided to move to version control to prevent ...
0
votes
2answers
325 views

Deleting post tags removes categories

I'm trying to remove old post tags from a few WP installs. In some instances, I have over 20k tags for a few thousand posts. I've tried the following code: delete t.*,tt.*,tr.* FROM wp_terms AS t ...
0
votes
1answer
385 views

Copy price categories to custom field

I have just made a big mistake today using a plugin to convert my 1000+ price custom fields into child categories under Price. I didn't know the custom fields will be deleted after the conversion. ...
1
vote
2answers
853 views

How to create another version of my site based on the same database

I have created a site and would like to create another version of the same site using the same exact database (db location, users, everything). The two sites would share one database. I already have ...
10
votes
2answers
5k views

Wordpress Database Slow - should I switch to InnoDB?

I have a WordPress site with well over 10k posts, and things are starting to get very slow whenever I am adding and editing posts. Pages load nice and fast for users, along with the admin lists of ...
0
votes
2answers
598 views

Import CSV to MySQL, with custom registration field information

I have to update the information of 1500 members of my clients Wordpress site. I'm using a membership to manage paidd subscriptions and I have to update the custom fields generated by this Plugin. I ...
0
votes
3answers
854 views

How to find if a post with custom_field == X exists?

I need to find if a post with a custom field X equal to Y exists in a wordpress installation. Should I do it with a simple sql query or is there something build in that can help me achieve it?
28
votes
8answers
20k views

Why is my database import losing text widget data?

I've created a site in WordPress on our development machine. In the theme we're using there are numerous widget zones to display text in (sidebar and front page). I've used simple Text widgets in all ...
6
votes
3answers
11k views

How do you properly prepare a %LIKE% SQL statement?

I'd like to use a LIKE %text% statement while still using the WordPress $wpdb class to sanitize and prepare input. SELECT column_1 from `prefix_my_table` WHERE column_2 LIKE '%something%'; I've ...
0
votes
2answers
836 views

Have working sql query… trying to adjust it to use $wpdb

So I have this code that queries a custom plugin generated table in the wp database. It works perfectly as is. But I'm trying to adjust it to use $wpdb instead of the $con function I have set up. ...
7
votes
4answers
10k views

What are the recommended database permissions for WordPress?

I just got WP running on my own server. I am not trying to lock things down more. What permissions should the db user have to my WP db?
4
votes
3answers
3k views

Optimize Multiple Taxonomy Term MySQL Query?

(Moderator's note: Title was originally: "query/database optimisation") I'm written a function for a custom "filter" search panel that allows users to select terms from up to four custom taxonomies. ...
0
votes
2answers
133 views

Can Categories be used to hack a Multisite-like setup w/ a single MySql db?

I have a project which will effectively create multiple blogs that will be fed existing content (don't worry, this isn't copyrighted content from other blogs or anything like that). From a DB ...
0
votes
4answers
237 views

database optimization and server errors

I've a self hosted wordpress blog. The server showing internal (500) server error and usually the system admins ask me to optimize my database. The database is relatively small in size and fits in few ...
7
votes
1answer
195 views

How do I optimize a custom post type admin page with 25,000 posts?

I'm getting the occasional excessive resource limit error to due to loading so many posts at once. We had set the PHP limit to 128 but just loading the list of posts for a couple of the post types is ...
10
votes
8answers
51k views

What SQL Query to do a simple find and replace

Whenever I create a new website I first create a staging site on a subdomain like "stage.domain-name.com". After everything works correctly I export the database, open it in notepad++ and do a ...
1
vote
1answer
1k views

Tags to Post-ID mysql query. Tag Search

Im trying to implement a tag-based search. When i specify certain tags, tagged posts will be searched and the post-id will be displayed that matches the searchcriteria. Currently it only works for a ...
5
votes
3answers
887 views

MySQL Replication Latency Issues in wp-admin pages

I have an environment running WP 3.0.1 with a Master db and two slaves. I am using HyperDB to force all writes to go to the Master, and all reads to read from the two slaves. I am experiencing a ...
1
vote
3answers
99 views

Styling images coming from another blog

I had asked a question earlier, on getting post-thumbnails from another WP-site. There, the awesome Mike coded a SQL query whose results are then passes on to a PHP array. The piece of code from that ...
1
vote
2answers
325 views

WP-DownloadManager - Query most download per week/month etc

I'm using this plugin (http://wordpress.org/extend/plugins/wp-downloadmanager/) as my download manager. While it's very simplistic and does great for what i need, the statistics to output on the site ...
1
vote
3answers
340 views

Performance on WPMS

my WPMS site is hosted on 8 cores/32mb RAM server but the response time is very high. We have about 1000 blogs (35,000+ tables on single db) and 70,000 pageviews per mounth. I think that i can down ...
6
votes
1answer
733 views

Would switching to InnoDB from MyISAM improve performance of comments table?

A site I've built gets lots of comments in a short space of time - so perhaps 100 comments might be left in 5 or 10 minutes. This seems to cause a pretty heavy load on the database, especially when ...
1
vote
1answer
2k views

How can I SQL update a meta_value to remove the dollar signs that were entered with the value? (so just the value remains)

For all the "price" custom fields of a site, the dollar sign was entered with the value. I need to remove the dollar sign and leave the just the values. I know very little about SQL queries. The ...
18
votes
3answers
16k views

MySQL Database User: Which Privileges are needed?

The short installation instruction for WordPress ("5 Minutes") state that: Create a database for WordPress on your web server, as well as a MySQL user who has all privileges for accessing and ...
0
votes
2answers
9k views

Scanning Database for malicious Data

After a site of a friend has been hacked I told him he should just clean up the mess and restart from scratch so he know that no file has been altered. I could scan the site for him with tools like ...
1
vote
3answers
1k views

importing users where password is provided as md5 + much metadata

I have a spreadsheet that was provided to me of users to import to a new site I have built. I was provided with the password in MD5 hash form. I suspect if I insert this into the password field in ...
0
votes
1answer
267 views

Custom Search, MySql Query Gone Wrong?

I'm having a bit of a brain fart on this one. I'm working on some code that resembles a custom search form. The custom search form, is a mixture of checkboxes as well as some drop downs. All of the ...
1
vote
1answer
385 views

MySql database help for a plugin

I am using a WordPress plugin called MyReview but I want some changes to it. That plugin has feature to review posts, where users will come and give star ratings to the post according to categories, ...
0
votes
2answers
378 views

Copying post thumbnail to custom field

I've just moved to another theme, and it uses the custom field bigimage for associating an image with a post, instead of using WordPress's post thumbnails. How do I copy the URLs of all existing ...
8
votes
8answers
12k views

How to replace the domain name in a Wordpress database?

I have a Wordpress database which was installed in a development environment... thus, all references to the site itself have a fixed IP address (say 192.168.16.2). Now, I have to migrate that database ...
0
votes
2answers
66 views

Removal of all posts content in bulk, keeping the posts itself

How to, using PHP scripting or WordPress overwrite all of the posts (permamently, so it takes effect on database) with some static text such as "Content removed."?
1
vote
1answer
2k views

query users by role

I have a custom plugin which queries users and usermeta, but I now need to filter admins out of the results. A very simplified version of my sql query is: SELECT * FROM usermeta LEFT JOIN users ON ...
0
votes
3answers
889 views

Code to remove authors with no posts connected to them

I am looking for SQL code that I can run from phpmyadmin to remove all registered users on the blog that do not have any post associated with them.
2
votes
1answer
3k views

Importing users to Buddypress with custom fields

Here's the setup: The client uses a proprietary custom-coded PHP CMS and is wanting to move to WordPress with BuddyPress. The old, custom CMS has a roster functionality, which I'm using BuddyPress ...
1
vote
3answers
500 views

Search and replace text across all posts

I had used the ZD Video Plugin for WP a long time, and now, since my move to WP 3.0.2, it doesn't work anymore. To embed a YouTube video using the plugin, I would just write ...
5
votes
3answers
904 views

Resetting comment count

Recently, I had to move to another domain and had to recreate all my MySQL tables on the enw server. I noticed that for some posts, the number of comments is doubled. Example - ...
1
vote
3answers
455 views

Insert all post IDs in new database table

I have a plugin which creates a new database table. Upon activating the plugin is there a way to insert all my posts ids into that table? Right now I'm using an action hook to immediately insert the ...