Optimal Mysql configuration in development?

During development, I include the following:

my.cnf:

[mysqld]
log_slow_queries    = /var/log/mysql/mysql-slow.log
sql_mode            = STRICT_ALL_TABLES

SQL_MODE

STRICT_ALL_TABLES

Enable strict mode for all storage engines. Invalid data values: rejected.

For example, consider the following:

CREATE TABLE `posts` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `title` varchar(200) NOT NULL,
    `date` datetime NOT NULL
);
INSERT INTO `posts` (`title`, `date`) VALUES ('Title text', NULL);

If you use STRICT_ALL_TABLES sql_mode, mysql will not throw an error when trying to insert a value NULLinto a column NOT NULL, instead mysql will insert default data depending on the type of column. for example for a datetime column NOT NULL, when you insert a value NULL, mysql will use the default datetime value for 0000-00-00 00-00-00.

Strict mode, in a sense, is like raising the level of report_ error and displaying errors in PHP, which is best practice during development.

ini_set('error_reporting', -1);
ini_set('display_errors', true);

, , , ?

+2
1

:

# creates a innodb file per table instead of having all the tables in a single tablespace file
innodb_file_per_table 

# increase the max allowed packet to a large size for file imports
max_allowed_packet = 32M

# the InnoDB pool size. use up to 80% available RAM for dedicated machines, and as much
# as you can spare for development machines also depending on the size of the databases
# you will be running so that as much of the database as possible fits into memory 
innodb_buffer_pool_size = 512M
+1

All Articles