MySQL
Service overview
| Software owner | Percona LLC |
|---|---|
| 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 | BhYx!@o5%m | 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/mysqld
ss 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 next command:
netstat -lntp | grep mysql
Check 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
Wfmanager util can also be used to check mysql out (access) log:
wfmanager tail mysql
Count number of running mysql processes, it should not be less than 1:
pgrep mysqld | wc -l
Check MySql version. There are several ways to do so. One of them connect to Mysql firstly and run:
run_mysql_command "SELECT @@version;"
Or just run from the user that has installed workfusion:
mysql -V or mysqld -V
Display 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 installed workfusion:
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 installed workfusion:
mysql -u root -p$MYSQL_ROOT_PASS -e "show session status;"