MySQL file locations

Posted under » MySQL » Ubuntu » Mac updated on 29 July 2020

Sometime, you want to change your configuration, like making mysql use memory or receive this error "The MySQL server has gone away (error 2006)". Then you need to change your config.

set max_allowed_packet = 128M

Though it is not advisable to log mysql, it is useful if you want to troubleshoot by specifying at the config.

[mysqld]
general_log_file        = /var/log/mariadb/mysql.log
general_log             = 1

Just make sure the permissions are correct

Applies to Ubuntu

Applies to CentOS 7

this is where the databases are located.

However, in some cases, you might want to put it elsewhere or make it portable.

web security linux ubuntu GIT svn Raspberry apache mysql php drupal cake symfony javascript Ajax css