MySQL

MySQL Logo
| 4 min read
From MySQL 5.7 onwards, the error SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column will appear if any non aggregated columns are in the select list, which is not in the group by clause. This article discusses one such use case with Mautic and how we solved it.
Zyxware default image3
| 2 min read
Have you ever faced an error 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock', while trying to log in to MySQL as any user? You can login to your MySQL via the following terminal command. mysql -u root -p or mysql -u root -pPassword Its recommended, not to use passwords in terminal command, due to privacy reasons. Verify that, your MySQL is running. If not, start service by typing following command in your Linux terminal. sudo service mysql start or
Zyxware default image2
| 2 min read
Slick is a powerful solution for slideshow/carousel. It supports nested sliders and can be implemented in your custom block of Drupal 7 site. Slick has jQuery dependency. Download the latest jQuery and use in your page or use jQuery update module for Drupal 7. Download slick libraries from https://github.com/kenwheeler/slick/. Extract the folder and place it in sites/all/themes/yourtheme/ and rename the library as slick. While creating slider, we need to use only slick.css and slick.min.js in the folder slick-slider/slick.
Zyxware default image4
| 4 min read
Before we discuss on how to to join multiple database tables using db_select in Drupal 7, let me tell you that we can add as many joins as we want and most methods such as, 'fields', 'conditions', joins etc. can be called multiple times. However, one thing may be worth mentioning is that the call to join() needs to be separate. It should not be "chained", meaning that one should use this,
Zyxware default image2
| 3 min read
Command line provides a platform to that takes input from keyboard to interact with the operating system. In Linux Operating System's, the Command line is often referred to bash. MySQL in Command Line
Zyxware default image1
| 3 min read
In one of the Drupal sites were working on, the members of the site frequently found that the nodes they had created were crashing. They would enter content into the node fields and try to save the node. The node would appear to save with apparently no error message. They found that it was not accessible at all afterwards. This wasn't occurring for everyone. We checked the dblog and we saw that the users were getting the error PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect string value:. Read on to know how we solved this issue.
Zyxware default image2
| 4 min read
We as a PHP Drupal web platform developer most often has to face the situation to export data from one table to another table of same database or to table of another database (if site uses multiple databases) during the process of any change in normal work flow. Most of us normally think to export the data from one table to another by firstly querying the required data from source table and then looping through the query result and inserting them to destination table. This can be simply achieved with a single query.
Zyxware default image2
| 2 min read
This article lists some of the basic MySQL commands how to create a new database, a new database user and granting privileges to a user. How to create a new database from terminal. The first step here is to log in as the MySQL root from terminal using the following command. mysql -u root -p Now this will prompt for the MySQL root password. Enter password : After entering the MySQL root password we will be able to log in to the MySQL prompt. The next step is to create the new database.
Zyxware default image4
| 2 min read
Many Drupal users received a "user warning: Got error 28 from storage engine query: SELECT DISTINCT b.* FROM blocks b LEFT JOIN blocks_roles r ON b.module = r.module AND b.delta = r.delta WHERE b.theme = 'garland' AND b.status = 1 AND (r.rid IN (2,3) OR r.rid IS NULL) ORDER BY b.region, b.weight, b.module in /home/your-username-here/public_html/modules/block/block.module on line 433." If you are facing the same situation in your Drupal site then read on to find out the solution.
Zyxware default image3
| 2 min read
As a web developer, we sometimes may want to export a specific table from a MySQL database. It can be particularly helpful when we are going to apply some changes to a table that is part of a large database and we are interested in backing up that specific table only, rather that whole huge database. To create a backup (also called dump) of the a table use this command: mysqldump -u username -p db_name table_name | gzip > db_name.table_name.sql.gzThis will create the backup/dump for the table in the file in compressed format.