Update for MySQL 8.0
Your sql-mode
will not have NO_AUTO_CREATE_USER
as it has been removed as mentioned here - how-to-set-sql-mode-in-my-cnf-in-mysql-8
[mysqld]
sql-mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"
Also if someone doesn't have a my.cnf
file then they can create a new one in /etc/mysql/my.cnf
and then add the above lines.