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
8 views

Drush sql-sync failing with Ubuntu 14.04

I'm having no luck with sql-sync, there's two seemingly unrelated errors it's throwing at me which I'll detail below. I've been successfully sql-sync'ing the same site to another server, so I'm ...
0
votes
0answers
12 views

Cleaning database after Import

I imported millions of nodes (ca. 3 Millions) but i needed to abort sometimes and continue the Import. (like RAM resources) The Import is correct but i did a look into Drupal 7 Database and saw that i ...
0
votes
1answer
43 views

Does Drupal 7 support connecting to DB using MySQLi?

I have tried to connect to Mysql DB using Mysqli by declaring 'driver' => 'mysqli' inside DB array in settings.php but I get the following error: Warning: ...
0
votes
0answers
21 views

Using a different local non-Drupal database to store entities?

So we have a simple mysql database that stores information about people, which is used by multiple sites on our environment. I'd like to use entities to interact with this database, but I can't figure ...
0
votes
1answer
14 views

Migration failed with source plugin exception

I'm getting the following error: Migration failed with source plugin exception Migration failed with source plugin exception: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: ...
0
votes
0answers
18 views

Condition not working

I'm trying to do a sql which is $sql ="Select r.* FROM event_mgmt_registration r WHERE event_nid = $node->nid AND reg_id = $reg_id"; in drupal (as below) $node = node_load($nid); ...
0
votes
0answers
11 views

Drupal Views Relationship in Code

I am trying to write a custom relationship between two tables for Views, and it doesn't seem to be working. The code for my relationship is this: $data['gov_data_bill']['sponsor'] = array( ...
0
votes
1answer
47 views

Converting MySQL to db_select with subquery count

I have an SQL query, with subquery, that returns as set of nodes ordered by referenced nodes... It works fine in a db_query, but I need it to be dynamic, and it feels like a better idea to use ...
0
votes
1answer
40 views

Your web server does not appear to support any common PDO database extensions

I'm trying to install Drupal7 or Drupal8 and keep getting this error: Database support Disabled Your web server does not appear to support any common PDO database extensions. Check with your ...
0
votes
2answers
33 views

Can drupal be installed on a subdomain and used on the main domain?

I was thinking about installing Drupal on admin.myexample.com for clients to access an add and edit news posts & products. Then just using myexample.com as the main site. Calling the database and ...
0
votes
1answer
36 views

Collecting user and node locations seperate or combined?

In my drupal site i like to have the location of users stored as well as the location of nodes. To store these locations i am using Geofield in combination with adressfield. Adressfield collects the ...
0
votes
1answer
35 views

How to exclude the user table using the drush sql-sync command

Could anyone tell me how to exclude drupal's user table from drush's sql-sync command? Thank you.
0
votes
1answer
59 views

Drupal Commerce Kickstart 2 Mysql problem: “Table XYZ is marked as crashed and should be repaired” [closed]

My drupal kickstart 2 site occasionally cause Mysql errors. This is what Drupal Logs say: "PDOException: SQLSTATE[HY000]: General error: 145 Table './MYSITE/field_revision_body' is marked as crashed ...
0
votes
0answers
22 views

Drupal Quickstart / Drupalpro - mysql misconfigured to “drupalpro” user

I've been trying to do a drupal quickstart-create database and its creating the database, but it only shows up on the root account, but its not creating it on the current user's account "drupalpro" ...
0
votes
3answers
52 views

Get all rows from database

I have the table where I store uid column, and I want to get all values from table, but I only get the frist elemnt, where is my problem ? My query: $sql = db_select('voting_nomination_counter', 'v') ...
-1
votes
0answers
20 views

On click of checkbox send email to selected recipients [duplicate]

<?php if( isset($_POST['Submitter']) && !empty($_POST['Submitter']) ) { $to = "syz@gmail.com"; $subject = "Test Subject"; $body = "Test Body"; $headers = "From: ...
0
votes
0answers
54 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
111 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
31 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
37 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
58 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
73 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 ...
2
votes
1answer
129 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
42 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
37 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
1answer
109 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
43 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
58 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
24 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
37 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
28 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
44 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
37 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
205 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
28 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
42 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
46 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
54 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
21 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
83 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
48 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 ...
3
votes
1answer
236 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
85 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
49 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
32 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
25 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
157 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
67 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
141 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
94 views

Why drush sql-sync fails with mysqldump unknown variable error?

I am having issues trying to sync my staging server with my local server using drush sql-sync command. I've set my aliases right and the same configuration is working with my development server and ...