Mysql als Docker

Aus Roebke Wiki
Version vom 21. Oktober 2021, 08:18 Uhr von Daniel (Diskussion | Beiträge) (1 Version importiert)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Zur Navigation springen Zur Suche springen



sudo docker run --detach --name=test-mysql --env='MYSQL_ROOT_PASSWORD=**PASSWROT****' mysql
sudo docker inspect test-mysql

-> "IPAddress": "172.17.0.4"

From the physical host, we can now access the MySQL server. Ensure the MySQL client package is installed beforehand

daniel@ubuntu-2gb-nbg1-1:~$ sudo mysql -uroot -pPASSWORT -h 172.17.0.4 -P 3306
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.13 MySQL Community Server - GPL

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 

docker run --detach --name nextcloud4 --link test-mysql:mysql nextcloud



Quelle: