MySQL with Docker

Skip to main content
Du bist hier:
Drucken

MySQL with Docker

MySQL Restore with Docker

If you want to restore a database from another server or quickly test something on a MySQL server, you can do this quickly and easily using Docker.

 

  1. Install a server with the Docker package
  2. docker run \
    --detach \
    --name=mariadb \
    --env="MYSQL_ROOT_PASSWORD=GEHEIMESKENNWORT" \ --publish 6603:3306 \ --volume=/docker/data:/var/lib/mysql \ --volume=/docker/conf.d:/etc/mysql/conf.d \
    mariadb:10.5.12
    

    maraidb:10.5.12 Version can be specified arbitrarily. Can also be mysql instead of mariadb.

  3. From the original database server, copy the MySQL database data from /var/lib/mysql to the /docker/data folder.
    You can also use rsync for this.
  4. Then execute the following command:
    docker mariadb restart
  5. If you are restoring a Plesk database server, you can also use the file /etc/psa/.psa.shadow.
Related Post