Portabase Logo
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.

Docker Compose Example

Example with a MySQL image.

docker-compose.yml
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.

Last updated on

On this page