I've found creating a symlink to the enhance docker mysql socket helpful for situations where you can't change the default socket path for MySQL in specific tools.
mkdir -p /var/run/mysqld
ln -s /var/local/enhance/mysqlcd-run/mysqld.sock /var/run/mysqld/mysqld.sock
I feel like this should be a default?
This doesn't persist during reboot, so I just created this bash script to create a systemd service.
#!/bin/bash
SERVICE_NAME="mysqlcd-startup"
SERVICE_FILE="/etc/systemd/system/$SERVICE_NAME.service"
# Create the systemd service file
echo "Creating systemd service file..."
sudo tee $SERVICE_FILE > /dev/null << EOF
[Unit]
Description=Run custom commands at startup
After=network.target
[Service]
Type=simple
ExecStart=/bin/bash -c 'mkdir -p /var/run/mysqld && ln -s /var/local/enhance/mysqlcd-run/mysqld.sock /var/run/mysqld/mysqld.sock'
[Install]
WantedBy=multi-user.target
EOF
# Reload systemd manager configuration
echo "Reloading systemd manager configuration..."
sudo systemctl daemon-reload
# Enable the new service
echo "Enabling the service..."
sudo systemctl enable $SERVICE_NAME
# Start the service immediately (Optional)
echo "Starting the service..."
sudo systemctl start $SERVICE_NAME
echo "Setup complete. The service will run on startup."
Also, what's appcd-cli upgrade-mysqlcd-to-mysql
do?