How to Disable MySQL Strict Mode

MySQL’s, and MariaDB’s, strict mode controls how invalid or missing values in data changing queries are handled; this includes INSERT, UPDATE, and CREATE TABLE statements. With MySQL strict mode enabled, which is the default state, invalid or missing data may cause warnings or errors when attempting to process the query.

When strict mode is disabled the same query would have its invalid, or missing, values adjusted and would produce a simple warning. This may seem like the preferred result, however with strict mode disabled certain actions may cause unexpected results; for instance, when the value being inserted exceeds the maximum character limit it will be truncated to fit the limit.

There are various reasons why MySQL’s strict mode may need to be disabled, however the most common is when a server is running WHMCS — this is a requirement of that tool.

Pre-Flight Check

  • These instructions are intended specifically for disabling MySQL strict mode on a managed Liquid Web server with cPanel.
  • The server should be running either MySQL 5.6/5.7 or MariaDB 10.x
  • Command line and root level access via SSH will be necessary to follow this tutorial.

Step #1: Make Backups, Always!

Whenever modifying files on a server it’s always best practice to take some form of a backup beforehand. This ensures you have a way to revert changes if something goes awry; it’s also beneficial because it helps track when and what changes were made.

While logged into SSH with the root user, do the following:

cp -a /usr/my.cnf{,.strict.bak}
cp -a /etc/my.cnf{,.strict.bak}

The above command uses ‘BASH brace expansion’ in order to make a backup copy of the file in its original directory.

Step #2: Disable MySQL Strict Mode

Depending on the server and the current configurations you may need to edit one, or both, of the following files on the server. Generally, the relevant configuration lines are only in one of them, however, it could be in either one without causing issues; so generally it’s best to check both.

To edit the files, you will open the file with your favorite command line editor. In this example, we use ‘vim’.

vim /usr/my.cnf
vim /etc/my.cnf

In vim, you can press “a” or “i” to enter text insertion mode; pressing the escape key (Esc) on your keyboard returns you to command mode. For a refresher on editing files with vim, see our New User Tutorial: Overview of the Vim Text Editor.

Within each file above you will be looking for a line with the following content:

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

If you find a line similar to the above that is setting the `sql_mode` variable then you will need to replace it with the following line to disable MySQL strict mode.

sql_mode=""

Once this adjustment has been made, or you’ve confirmed the file does not need to be adjusted you will then save and close the file.

Step #3: Restart the MySQL Service

Finally, to make these changes effective you will need to restart the MySQL service as it will only read the configuration files when it initially loads up. In order to force MySQL to use the new configuration files you will do the following:

For CentOS 7 servers:
systemctl restart mysql

For CentOS 6 and prior:
/etc/init.d/mysql restart

After issuing this command on the server the MySQL service will be restarted and will load the changes made. If all the directions were followed and completed, then MySQL strict mode should now be disabled.

To verify that the process was completed properly you can run the following:

mysql -e "SELECT @@sql_mode;"

The output may look similar to the following:

+--------------------------------------------+
| @@sql_mode
+--------------------------------------------+
| NO_AUTO_CREATE_USER
+--------------------------------------------+

If you have any questions or are not comfortable making these changes yourself, please feel free to contact Heroic Support®.

How To Install MySQL/MariaDB on Fedora 23

MariaDB is a drop-in replacement for MySQL. It is easy to install, offers many speed and performance improvements, and is easily integrated into most MySQL deployments. MariaDB offers more storage engines than MySQL, including Cassandra (NoSQL), XtraDB (drop-in replacement for InnoDB), and OQGRAPH.

Pre-Flight Check

  • These instructions are intended for installing MariaDB on a single Fedora 23 node.
  • We’ll be working as root on a Liquid Web Self Managed Fedora 23 server.
  • If you have any questions about compatibility, you can find answers at: MariaDB versus MySQL – Compatibility.

Step #1: Install MariaDB

As always, we’ll first ensure that our existing packages are up to date:

dnf -y update

MariaDB can be installed with one command:

dnf -y install mysql-server mysql

Step #2: Start MySQL/MariaDB

Start MySQL (now MariaDB) with the following command:

systemctl start mariadb

To ensure that MySQL/MariaDB starts at boot, run the following command:

systemctl enable mariadb

That should produce output similar to the following:

[root@host ~]# systemctl enable mariadb
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.

You can check the status of MySQL/MariaDB with:

systemctl status mariadb

Step #3: Using MySQL/MariaDB

You connect to MySQL/MariaDB with the following command:

mysql

That should produce output similar to the following:

[root@host ~]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 5
Server version: 10.0.21-MariaDB MariaDB Server
Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

To exit and return to your command prompt, simply execute the following command:

exit
 

How To Install MySQL / MariaDB on Fedora 22

MariaDB is a drop-in replacement for MySQL. It is easy to install, offers many speed and performance improvements, and is easy to integrate into most MySQL deployments. Answers for compatibility questions can be found at: MariaDB versus MySQL – Compatibility. MariaDB offers more storage engines than MySQL, including Cassandra (NoSQL), XtraDB (drop-in replacement for InnoDB), and OQGRAPH.

Pre-Flight Check

  • These instructions are intended for installing MariaDB on a single Fedora 22 node.
  • I’ll be working from a Liquid Web Self Managed Fedora 22 server, and I’ll be logged in as root.

Continue reading “How To Install MySQL / MariaDB on Fedora 22”

What is a Virtual IP (VIP)?

What is a Virtual IP (VIP)?

When you create a virtual IP (VIP) address with Liquid Web you will receive both a Public VIP and Private VIP. The public VIP can be configured on a Storm server just as a non-virtual, or standard, IP would be configured. Connecting to a public service, such as HTTP or FTP, on the Public VIP occurs just as it would on a standard IP.

The Private VIP can be configured on a Storm server’s private interface just as a standard private IP would be configured. Connecting to a private service, such as MySQL or Puppet, on the Private VIP also occurs just as it would on a standard private IP.

So why use a VIP? When utilizing multiple servers, having a VIP is beneficial due to its ability to “float” between servers. This allows the VIP to remain highly reachable in circumstances in which a non-virtual (or standard) IP may be otherwise unreachable. It is possible to move both the Public VIP and Private VIP between Storm servers!

Both Public and Private VIPs can be configured on any server on your Storm account so long is that server is in the Zone where the VIPs were created. Typically software, such as the ones listed below, is used to manage on which server a VIP resides.

Use Cases for VIPs

Here are some of the things that you can do with Virtual IP addresses:

  • High Availability Databases (MySQL, Percona, MariaDB)
  • Non-DNS-based Service Migrations
  • High Availability Web Applications (in tandem with or in place of load balancer)
Examples of Software That Can Use VIPs

This is just some of the software that you can use with Virtual IP addresses:

Try a Free Cloud Server.

Trying a new server is a breeze, and it’ll be up and running in only a few minutes...

How to Install MariaDB 5.5 on Ubuntu 14.04 LTS

MariaDB is a drop-in replacement for MySQL. It is easy to install, offers many speed and performance improvements, and is easy to integrate into most MySQL deployments. Answers for compatibility questions can be found at: MariaDB versus MySQL – Compatibility. MariaDB offers more storage engines than MySQL, including Cassandra (NoSQL), XtraDB (drop-in replacement for InnoDB), and OQGRAPH.

Pre-Flight Check
  • These instructions are intended for installing MariaDB 5.5 on a single Ubuntu 14.04 LTS node (without MySQL already installed).
  • I’ll be working from a Liquid Web Self Managed Ubuntu 14.04 LTS server, and I’ll be logged in as a non-root user, but with sudo access. For information on giving a user sudo access visit our page on How to Add a User and Grant Root Privileges on Ubuntu 14.04.

Continue reading “How to Install MariaDB 5.5 on Ubuntu 14.04 LTS”

How To Install MySQL / MariaDB on CentOS 7

MariaDB is a drop-in replacement for MySQL. It is easy to install, offers many speed and performance improvements, and is easy to integrate into most MySQL deployments. Answers for compatibility questions can be found at: MariaDB versus MySQL – Compatibility. MariaDB offers more storage engines than MySQL, including Cassandra (NoSQL, in MariaDB Version 10), XtraDB (drop-in replacement for InnoDB), and OQGRAPH (in MariaDB Version 10).

Pre-Flight Check

  • These instructions are intended for installing MariaDB on a single CentOS 7 node.
  • I’ll be working from a Liquid Web Self Managed CentOS 7 server, and I’ll be logged in as root.

Continue reading “How To Install MySQL / MariaDB on CentOS 7”

How To Install MySQL / MariaDB on Fedora 21

MariaDB is a drop-in replacement for MySQL. It is easy to install, offers many speed and performance improvements, and is easy to integrate into most MySQL deployments. Answers for compatibility questions can be found at: MariaDB versus MySQL – Compatibility. MariaDB offers more storage engines than MySQL, including Cassandra (NoSQL), XtraDB (drop-in replacement for InnoDB), and OQGRAPH.

Pre-Flight Check

  • These instructions are intended for installing MariaDB on a single Fedora 21 node.
  • I’ll be working from a Liquid Web Self Managed Fedora 21 server, and I’ll be logged in as root.

Continue reading “How To Install MySQL / MariaDB on Fedora 21”

How to Install the Open Query Graph engine (OQGRAPH) for MariaDB 10.0 on Fedora 20

MariaDB is a drop-in replacement for MySQL. It is easy to install, offers many speed and performance improvements, and is easy to integrate into most MySQL deployments. Answers for compatibility questions can be found at: MariaDB versus MySQL – Compatibility. MariaDB offers more storage engines than MySQL, including Cassandra (NoSQL), XtraDB (drop-in replacement for InnoDB), and OQGRAPH.

Pre-Flight Check
  • These instructions are intended for installing the Open Query Graph engine (OQGRAPH) for MariaDB 10.0 on Fedora 20.
  • I’ll be working from a Liquid Web Self Managed Fedora 20 server, and I’ll be logged in as root.
  • Your server should already have MariaDB 10.0 installed. If you’re working from MariaDB 5.5 visit our tutorial on: How to Upgrade MariaDB 5.5 to MariaDB 10.0 on Fedora 20

Continue reading “How to Install the Open Query Graph engine (OQGRAPH) for MariaDB 10.0 on Fedora 20”