Category : MySQL

Here is a simple lamp install script for CentOS 8. #!/bin/bash #update system dnf update #install apache dnf install httpd httpd-tools -y systemctl enable httpd systemctl start httpd systemctl status httpd #update firewall firewall-cmd –permanent –zone=public –add-service=http firewall-cmd –permanent –zone=public –add-service=https firewall-cmd –reload #install mariadb dnf install mariadb-server mariadb -y systemctl start mariadb systemctl enable ..

Read more

I am using mariadb and I to investigate some issue I wanted to check the logs. To my surprise, log file is not generated for mariadb. I suspect this cannot be the case so I am doubting my search skills. MariaDB [(none)]> show variables like ‘log_error’ -> ; +—————+——-+ | Variable_name | Value | +—————+——-+ ..

Read more

Error when exporting a dump in plesk databases (See:https://docs.plesk.com/en-US/onyx/reseller-guide/website-management/website-databases/exporting-and-importing-database-dumps.69538/): Warning: Using unique option prefix database instead of databases is deprecated and will be removed in a future release. Please use the full name instead. Cause key_buffer and myisam-recover are deprecated in Mysql 5.5. myisam-recover option is renamed as of MySQL 5.5.3 to myisam-recover-options . Resolution ..

Read more

Recently I ran a command in mysql that resulted in this error: mysql: [ERROR] unknown variable ‘sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION’ So I had to add a line to the mysql config file. In Ubuntu 16: # nano /etc/mysql/mysql.conf.d/mysqld.cnf Add the following line under mysqld [mysqld] sql_mode = “STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION” Restart mysql: # systemctl res..

Read more

Here is the original /etc/my.cnf file for a default mariadb installation: [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 # Settings user and group are ignored when systemd is used. # If you need to run mysqld under a different user or group, # customize your systemd unit file ..

Read more

The basic formulas are: Available RAM = Global Buffers + (Thread Buffers x max_connections) max_connections = (Available RAM – Global Buffers) / Thread Buffers To get the list of buffers and their values: SHOW VARIABLES LIKE ‘%buffer%’; Here’s a list of the buffers and whether they’re Global or Thread: Global Buffers: key_buffer_size, innodb_buffer_pool_size, innodb_log_buffer_size, innodb_additional_mem_pool_size, ..

Read more

Do you wonder which databases are actually taking up how much space but only have one huge ibdata1 in your /var/lib/mysql and the directories inside your mysql data directory don’t represent the actual database sizes? Run from a mysql root console: mysql> SELECT table_schema AS “Database name”, SUM(data_length + index_length) / 1024 / 1024 AS ..

Read more