SUSE Support

Here When You Need Us

SCA Appliance configuration reports ERROR 2002 (HY000): Can't connect to MySQL server

This document (000020301) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 15
SUSE Linux Enterprise Server 12 SP5
SUSE Linux Enterprise Server 12 SP4
 

Situation

When running setup-sca, the following error is observed:
...
SCA Agent Configuration        ERROR
####################################################################
# SCA Agent Configuration Tool v1.0.6
####################################################################

ERROR 2002 (HY000): Can't connect to MySQL server on 'sles15sp2' (115)

ERROR: Cannot obtain AgentID on sles15sp2-base for sles15sp2
Consider running setup-sdagent on the Broker server.
Runnnig scadb shows the following:
Table: Agents
+-----------+------------+---------------------+---------------------------------+---------------+------------+
| Hostname  | AgentState | AgentEvent          | AgentMessage                    | ThreadsActive | CPUCurrent |
+-----------+------------+---------------------+---------------------------------+---------------+------------+
| sles15sp2 | Configure  | 2021-06-18 15:17:49 | Run sdagent-config on sles15sp2 |             0 |          0 |
+-----------+------------+---------------------+---------------------------------+---------------+------------+
The bind-address is configured in /etc/my.cnf for the loop back address
# grep bind-address /etc/my.cnf
bind-address    = 127.0.0.1

Resolution

Comment out the bind-address from /etc/my.cnf and restart the mariadb.service.
# grep bind-address /etc/my.cnf
#bind-address    = 127.0.0.1

systemctl restart mariadb.service
If you have not started the SCA Appliance Server configuration yet, run: setup-sca.

If you have already run setup-sca and received the errors described, you can manually run sdagent-config and install the cron jobs as follows:
/usr/sbin/sdagent-config -h $HOSTNAME -l $HOSTNAME -p sdagent_password -e root -i 'file:///tmp/'
crontab /usr/share/doc/packages/sca-appliance-broker/combined.cron
Once the configuration is complete and cron jobs have executed at least once, you will see an AgentMessage "Ready."
# scadb
Table: Agents
+-----------+------------+---------------------+--------------+---------------+------------+
| Hostname  | AgentState | AgentEvent          | AgentMessage | ThreadsActive | CPUCurrent |
+-----------+------------+---------------------+--------------+---------------+------------+
| sles15sp2 | Active     | 2021-06-24 18:16:02 | Ready        |             0 |         11 |
+-----------+------------+---------------------+--------------+---------------+------------+

Cause

As of SLES12 SP4, MariaDB changed the /etc/my.cnf bind-address to the localhost. This prevents remote a client access by default for security reasons. See https://mariadb.com/kb/en/configuring-mariadb-for-remote-client-access/.

Status

Reported to Engineering

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:000020301
  • Creation Date: 28-Jun-2021
  • Modified Date:28-Jun-2021
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.