Portabase AgentDatabases
MySQL
Configuration for MySQL.
The agent will use mysqldump to perform backups and restore backups.
Configuration
When running portabase db add, select mysql.
Specific parameters asked:
- Database Name: The name of the database to backup.
In your databases.json file, use the mysql type.
{
"name": "Test database 11 - Mysql",
"database": "mysqldb",
"type": "mysql",
"username": "mysqldb",
"password": "changeme",
"port": 3306,
"host": "db-mysql",
"generated_id": "..."
}Specific Parameters:
- database: (Required) The name of the database.
Docker Compose Example
Example with a MySQL image.
services:
db-mysql:
container_name: db-mysql
image: mysql:9.5
ports:
- "3312:3306"
environment:
- MYSQL_DATABASE=mysqldb
- MYSQL_USER=mysqldb
- MYSQL_PASSWORD=changeme
- MYSQL_RANDOM_ROOT_PASSWORD=yes
volumes:
- mysql-data:/var/lib/mysql
networks:
- portabase
agent:
image: portabase/agent:latest
# ... agent configuration ...
depends_on:
- db-mysql
networks:
- portabase
networks:
portabase:
external: true
volumes:
mysql-data:If you use localhost as the host (because the agent is on the host machine and not in Docker, or via host-gateway), ensure your database is listening on all interfaces (0.0.0.0) or is accessible from the agent.