MySQL is an open-source, relational database management system. Use this tag for questions specific MySQL, not for saying "I am using MySQL."

learn more… | top users | synonyms

0
votes
0answers
21 views

Database issue with Drush aliases on Windows

I'm having issues getting the drush sql-sync command working, and it seems to be related to how my site aliases are set up. When I try to run the sql-sync command with my local and production aliases, ...
0
votes
2answers
29 views

Drush can't connect to local MySQL through socket on WAMP

Trying to set up Drush with in a local dev environment on Windows 7 and can't get MySQL properly configured. A test command I've been running via Cygwin, with the resulting error, is as follows: $ ...
0
votes
1answer
25 views

Loading a large node body sequentially for better performance

I have a few very large nodes on my Drupal 7 site. In some cases the body field contains about 2MB of raw HTML (about 250,000 words). Despite the site performing well as a whole, the sheer size of ...
0
votes
2answers
23 views

Using db_select to only get the latest nodes with a certain field value

I have extending a query function for a D2D migration. The nodes have a field on them for a certain type of ID. In the old D6 site the the field did not have to be unique, but in the new D7 site the ...
0
votes
1answer
28 views

How to add two fieldConditons in Entity field Query?

Is this the correct way to add field Conditions $query->entityCondition('entity_type', 'profile2') ->entityCondition('bundle', 'user_profile') ->fieldCondition('field_town_city', ...
0
votes
1answer
23 views

multiple entity type in entity field query

how to add mutilple entity_type and bundles in EntityFieldQuery? $query->entityCondition('entity_type', 'profile2') ->entityCondition('bundle', 'user_profile'); Is there any way to do ...
0
votes
0answers
27 views

Webforms module breaks MySQL database

I've got 'Webform 7.x.3.20" installed on my Drupal 7 and it works perfectly, apart from it seems to have 'broken' the MySQL database. I first noticed this when I tried to use the 'Backup and Migrate' ...
2
votes
1answer
34 views

MySQL date format functions in Drupal

How can I do a MySQL date function in Drupal? I have this now: $select = db_select('someTable', 'st'); $select->addExpression('DATE_FORMAT(FROM_UNIXTIME(created), "%Y-%m")', 'createdMonth'); ...
1
vote
1answer
27 views

Troubleshooting a slow query

I've taken over a Drupal 7 website, and i'm having trouble with a slow query that is run when an editor visits the /admin/content page. The query in question is the following: SELECT COUNT(*) AS ...
1
vote
2answers
24 views

select nodes whose created date in hours is equal or larger than 48 hours

I make a PHP routine in which all node is selected and check created date and delete those nodes which is created in last 48 hours or greater. $result = db_query('SELECT n.nid, n.title, ...
0
votes
0answers
20 views

Drupal Mysql Proxy Configuration

Has anybody used mysqlproxy with Drupal ? First of all, can it be used like this. Or some tweaking to Drupal DB Abstration layer is required ? Here is mysql-proxy config: [mysql-proxy] ...
0
votes
1answer
41 views

Drush: how to set access to MySQL

When I run command "drush status" I cannot see any MySQL settings (user, password or database). I cannot use commands like "core-quick-drupal" because it requires access to MySQL, before ...
0
votes
1answer
29 views

changing unicode characters in a module

There are hundreds of records in a database that are in windows-1256 charset, I want to read these data and convert them to utf8 then insert them in a new table, to read these data I need to change ...
1
vote
1answer
33 views

Possible to use PDO inside a custom module in Drupal 6?

I'm about to build some new functionality on an old Drupal 6 site which will be upgraded to D7 or D8 within a year or so. This new module is heavy on the SQL and I'm building many complex SQL queries. ...
0
votes
0answers
16 views

Specify binary order in sql query

In custom module which selects field (collation: utf8_latvian_ci) from database ordered ouput gives wrong alphabetical order: "Aaaa, Āaaa, Abb, Acc" instead of "Aaaa, Abb, Acc, Āaaa". This can be ...
1
vote
1answer
31 views

Write form value to database

I need to save this to database, but could not find a way to make it work. Now this paypal_email is only saved to current user. Apparently it is saved somehow to the database under user table, but it ...
0
votes
1answer
25 views

Drupal - Microsoft SQL Custom database

I would like to get some opinions on the following challenge: A client of mine has a desktop application that has been built in .net and is backed by a Microsoft SQL server to store all the records. ...
1
vote
0answers
26 views

mysql_fetch_object returns object while false is expected [closed]

Im having a weird case where an object is being retrieved while Im expecting false, here is my query mysql> SELECT full_name, uid, name, picture FROM Table1 INNER JOIN Table2 using (uid) LEFT JOIN ...
0
votes
1answer
29 views

Move DB from Apache to IIS

I've been working on a Drupal site under a LAMP configuration. My client uses SQL Server, so after I'm done with development I need to move the site over to their configuration. I work on Linux, so I ...
3
votes
2answers
175 views

Where to query database in a module

I'm creating a module that is basically a form but needs to use information from a table in the database to react the some of the button presses. Rather than executing the database query each time the ...
0
votes
0answers
9 views

Notice: Undefined index: distribution_name in drupal_install_profile_distribution_name()

After upgrading from d6 to d7 it shows the notice as follows Undefined index: distribution_name in drupal_install_profile_distribution_name(). I want to solve this issue without changing any ...
0
votes
0answers
21 views

mysql error 1045 unable to access mysql database

I've been working with the DAMP stack for a while until I've been getting this error whenever I stop the server and re-initiate it. This is the following message. PDOException: SQLSTATE[28000] ...
0
votes
1answer
21 views

mysql.sock file deleted mistakenly from mysql/tmp [closed]

I was stuck with a PDO Exception PDOException: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in lock_may_be_available() (line 167 of ...
0
votes
2answers
189 views

Drush was not able to start (bootstrap) the Drupal database - MySQL Access denied error

I've installed Drush 7 using Composer and working with Drupal 8 and 7 on Ubuntu 12.04 with PHP 5.4.31, mysql 5.5.38 Drush will dl modules and themes just fine but when I want to en a module then it ...
0
votes
2answers
36 views

Complex condition drupal query

I'm trying to add following mysql condition: WHERE DAYOFYEAR(curdate()) <= DAYOFYEAR(DATE_ADD(FROM_UNIXTIME(field_birthday_value, '%y-%m-%d'), INTERVAL (YEAR(NOW()) - ...
0
votes
0answers
20 views

How I can disable block view from database D7 [duplicate]

PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away I have Last error, this error will be resolved when a user increase max allowad packet Im do it and set it 500MB, and Im ...
0
votes
1answer
38 views

Pulling user data from external database

I have a game that utilizes mongodb to store the user information. What I am trying to do is use drupal as a community front so users can register for the game in drupal. The problem is that I don't ...
0
votes
2answers
30 views

delete users and all its related records

Is there a way I could run mysql query from the backend to delete all the users and its related records except master-login. There are some modules that help to do it or a via drush command but I am ...
1
vote
1answer
94 views

How can I remove emoji from all user input?

It looks like iPhone emoji are not currently supported in Drupal 7 on MySQL. When I try to save a node containing an emoji (I 💛 U!) in the database, I get an SQL error: PDOException: ...
0
votes
2answers
63 views

How to create sql alias in drupal 7

How do you achieve the highlighted 'node' alias when using the Drupal 7 database abstraction language? This is the original query produced by the view SELECT node.title AS node_title, node.nid AS ...
0
votes
0answers
48 views

Tracking the userID

Where can I find the code where Drupal sends strings (such as the userID) from a content submission page to the node table in the database? If you know of a guide that explains the Drupal content ...
0
votes
1answer
28 views

Help me with my page, when open this page shows me this:

PDOException: SQLSTATE[HY000]: General error: 145 Table './mapibrasil/watchdog' is marked as crashed and should be repaired: INSERT INTO {watchdog} (uid, type, message, variables, severity, link, ...
0
votes
0answers
18 views

Drush won't bootstrap database in Windows

I'm using Windows IIS running under the Parallels Plesk control panel and installed Drupal 7.2.x and I also install Drush. I'm able to run basic commands but I'm unable to run any commands like SI or ...
0
votes
1answer
60 views

Corrupted mysql cache_rules table - dropped the table and now I cannot create it anymore!? Stuck

I'm not sure how this happens, but the cache_rules table is corrupted and it prevents me from doing a drush cache clear all. I dropped the table successfully, but now I can't create it. Throws this ...
0
votes
0answers
43 views

Drupal PrivateMSG Module: How to print Inbox msg Count & Outbox msg Count?

Can someone please tell me how to do this please? I know how to display the unread count, but i also need to print the inbox and outbox count in my custom module. Some help would be much appreciated, ...
1
vote
1answer
39 views

EntityFieldQuery with “NOT IN” FieldCondition and “=” FieldCondition on the same multi-value field is only processing one FieldCondition

The EFQ is: $query->entityCondition('entity_type', 'node') ->fieldCondition('field_terms_wb_access', 'tid', array_keys($children), 'NOT IN') ->fieldCondition('field_terms_wb_access', ...
1
vote
1answer
50 views

Find users who have not uploaded certain contents in last 30 days [closed]

I need to find users who have not uploaded certain contents in last 30 days. I have tried this query it is not working. Can anyone help me? select uid, max(created) as max_created from node where ...
0
votes
0answers
13 views

How do I handle large tables when performing a migration with the Migrate module

I am using the migration module to import a list of machine parts from a simple mysql table. The table has six columns and around 320,000 rows. My first attempt used a query that pulled in the ...
0
votes
1answer
145 views

Security issues while using external javascript and php files to access mysql database in drupal nodes

I have created a search_interface node which asks for filters and onClick event of the submit button, I have called an external search.js script. My search_interface node is of a custom content type ...
0
votes
1answer
86 views

Show custom query page based on user logged in

I want to make a customized query page based on the user who is logged in. The query page is a node made in custom made content type "query"(this content type has no additional fields than which are ...
0
votes
1answer
54 views

Recieving PDOExceptions and missing fields and table on Module installation

I'm new to Drupal and it's pretty much my first experience of adding Modules. I've mostly being using the Migrate module so far in. On loading I'm getting PDO errors which are created by either ...
0
votes
1answer
74 views

Finding data using MySQL queries in the Node tables

Outside of the Drupal system I am trying to get user data based off of the user table and export this information into a CSV. I'm not quite understanding how the Node table system works and where to ...
1
vote
0answers
14 views

I'm getting an error saying I'm inserting a duplicate entry when there isn't one

I have a form for users to update labels for cameras that my Drupal 7 module is displaying. When the user submits the form, first I check to see if the submitted value already exists int he DB: ...
0
votes
0answers
38 views

hook_views_data Join mySQL tables

I've 2 tables (remote db as afar as Drupal is concerned): pc_energy pc_energy_cstm I wish to join them on pcutl_pc_energy.id = pcutl_pc_energy_cstm.id_c While there are many cols in both tables I ...
1
vote
2answers
262 views

After enabling MySQL replication getting deadlocks when clearing cache

I recently setup my production MySQL server for replication. To do this I enabled innodb_flush_log_at_trx_commit and sync_binlog and set bind-address. A slave server on the opposite corner of the US ...
0
votes
3answers
224 views

How to populate DB values in content type field, drupal 7

I have created a content type with 4 field in Drupal 7. One field is of list type, say for listing countries. I have tables in DB for saving country_id and country_name. Is there any way to connect ...
0
votes
1answer
65 views

View API connection to external DB

I've a Drupal 7 site setup on an AWS server, and I'm trying to access a mysql db on a AWS RDS.(The Drupal db is located on the Drupal server, the table I'm trying to get is just to access some ...
0
votes
0answers
19 views

Drupal does not show site

I have the following error on my drupal Site, PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'filename' in 'field list': SELECT name, filename FROM {system} WHERE status = 1 AND ...
0
votes
1answer
55 views

why drupal webform form setting shows mysql errors in dblog?

I have created one webform in Drupal 7 in which some form components are present. But when I'm going to view that webform the components(fields) are not displayed. Then I checked in form setting that ...
0
votes
1answer
26 views

Upload and download doc,pdf file

in my site,i want users(students and teachers) to upload a file and and download the same by rest of the students and teachers.. is it possible? if so how can it be done.is there any module.