MySQL Connection Guide
Service Management
After creating the database, you will be redirected to the App Management page.
On this page, you can:
- Enable or disable your service
- View how to connect to the database service
- Customize the database configuration
Connection Information
Click on the Connection Method option in the Basic Settings tab.
On this page, you will see the following information:
- Internal Endpoint: The internal address of your database
- Port: The internal port of the database, which is
3306
by default - User: The database username that has been set automatically or manually
- Password: The database password that has been set automatically or manually
- Root Password: The root user password, which must be accessed using the internal site console
info
If you want to connect to the database from platforms other than the container (like your personal computer), click on the Create External Port option. Then use the External Endpoint as the hostname and the External Port instead of 3306
.
Connecting Methods
Using Navicat
-
Download and install Navicat.
-
Open Navicat and click on the Connection button.
-
Fill in the following information:
- Connection Name: A name for the connection
- Host Name/IP Address: External endpoint
- Port: External port
- User Name: The database username
- Password: The database password
-
Click on the Test Connection button to check the connection.
-
Click on the OK button to save the connection.
on Different Operating Systems
- Windows
- macOS
- Linux (Ubuntu/Debian)
Using Command Prompt
- Execute the following command:
mysql -u USERNAME -p PASSWORD -h HOSTNAMEORIP -P PORT -D DATABASENAME
Using MySQL Workbench
- Download MySQL Workbench from the official website.
- Run the program and click on "+" next to "MySQL Connections."
- Enter the connection information and click on "Test Connection."
- If the connection is successful, click "OK."
- Click on the new connection to connect to the database.
- Install the mysql-client package:
brew update
brew install mysql-client
- Connect to the database:
mysql -u USERNAME -p PASSWORD -h HOSTNAMEORIP -P PORT -D DATABASENAME
- Install the mysql-client package:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install libmysqlclient-dev
- Connect to the database:
mysql -u USERNAME -p PASSWORD -h HOSTNAMEORIP -P PORT -D DATABASENAME
tip
- MySQL uses the TCP protocol for connection.
- Before connecting, ensure that your system's firewalls allow connections to the specified port.