MySQL
Service overview
| Software owner | Percona LLC |
|---|---|
| Version | 5.7.18-15 |
| Management | wfmanager (start | stop | restart | status) mysql |
| Log files | Access logs: ${install_dir}/supervisord/log/mysql.out.log log-error: /opt/workfusion/mysql/var/log/mysqld.log |
| Startup scripts | ${install_dir}/supervisord/apps/mysql.ini |
| Configuration files | mysql main config file: ${install_dir}/mysql/usr/my.cnf |
| Default Ports | tcp 3306 |
Default parameters
| Configuration file | Name | Default Value | Description |
|---|---|---|---|
| config.yml | install_dir | /opt/workfusion | Directory to put user files, logs and configs |
| config.yml | mysql_port | 3306 | Default service port for MySQL DB |
| secrets.yml | mysql_admin_user | mysql | Admin username for MySQL DB on DB server |
| secrets.yml | mysql_admin_pass | mysql | Admin password for MySQL DB on DB server |
| secrets.yml | mysql_repl_user | repl | Username for MySQL DB replications on DB server |
| secrets.yml | mysql_repl_pass | repl | Password for MySQL DB replications on DB server |
Troubleshooting
Check if TCP port 3306 is available (port may be custom).
netstat command output
$ netstat -lntp | grep 3306 tcp6 0 0 :::3306 :::* LISTEN 17628/mysqldss command output
$ ss -ltn | grep 3306 LISTEN 0 110 :::3306 :::*lsof command output
$ lsof -P -n -i :3306 | grep LISTEN mysqld 17628 wfuser 18u IPv6 175662 0t0 TCP *:3306 (LISTEN)Or check if MYSQL TCP port is available with the following command:
netstat -lntp | grep mysqlCheck the default main log files:
- Access logs:
${install_dir}/supervisord/log/mysql.out.log - Error logs:
${install_dir}/supervisord/log/mysql.err.log
$ tail -f ${install_dir}/supervisord/log/mysql.err.log ${install_dir}/supervisord/log/mysql.out.log- Access logs:
Use the Wfmanager util to check MySQL out (access) log:
wfmanager tail mysqlCount the number of running MySQL processes, it should not be less than 1:
pgrep mysqld | wc -lCheck the MySQL version. There are several ways to do so. One of them connects to MySQL and run:
run_mysql_command "SELECT @@version;"Or just run from the user that has the installed product:
mysql -V or mysqld -VDisplay and check the current MySQL status:
${INSTALL_DIR}/mysql/usr/bin/mysql --port=$MYSQL_PORT -h 127.0.0.1 -u root -p$MYSQL_ROOT_PASS -e "status;"Or just run from the user that has the installed product:
mysql -u root -p$MYSQL_ROOT_PASS -e "status;"Display and check the MySQL current session parameters:
${INSTALL_DIR}/mysql/usr/bin/mysql --port=$MYSQL_PORT -h 127.0.0.1 -u root -p$MYSQL_ROOT_PASS -e "show session status;"Or just run from the user that has the installed product:
mysql -u root -p$MYSQL_ROOT_PASS -e "show session status;"