Zeabur provides a one-click deployment feature for MySQL service, allowing you to quickly deploy a MySQL database on Zeabur.
At present, Zeabur's MySQL service supports the
8.0 version. More versions
of the MySQL service will be supported in the future.
In your project, click Deploy New Service and select Deploy MySQL Service from Deploy Other Services.
After clicking Deploy, Zeabur will automatically deploy the MySQL service for you.
After deploying the MySQL service, Zeabur will automatically inject relevant environment variables into other services.
Sometimes, we can create a
DATABASE_URL to replace the above environment variables, for example:
<DATABASE_NAME> is the name of the database that you added yourself.
By default, the username and database name in Zeabur's MySQL are both
root. Here, we need to add the first database ourselves, which can be done in the following ways.
MySQL Workbench (opens in a new tab) is a database visualization tool that can be used to design, maintain, and manage MySQL databases. It has an easy-to-use interface and can be used to query, back up and restore databases, as well as diagnose and optimize database performance.
You can use MySQL Workbench (opens in a new tab) to connect to the MySQL database deployed on Zeabur.
First, you need to click the button next to MySQL connections to add a connection.
Then, click Store in Keychain to save the password.
Next, you can execute SQL syntax in the Query Editor to add a database. Enter:
CREATE DATABASE <DATABASE_NAME>
First, you can connect to the MySQL database deployed on Zeabur using the following command:
mysqlsh --uri mysql://root:<MYSQL_PASSWORD>@<MYSQL_HOST>:<MYSQL_PORT>
Then, switch to SQL mode:
Finally, you can execute SQL syntax to add a database. Enter:
create database <DATABASE_NAME>;