1.搜索OpenGauss
docker search opengauss
2.選擇其中一個源拉取
docker pull docker.io/enmotech/opengauss
3.運行OpenGauss
docker run --name opengauss --privileged=true --restart=always -d -e GS_USERNAME=postgres -e GS_PASSWORD=myGauss@2023?-p 5432:5432 docker.io/enmotech/opengauss
其中GS_USERNAME參數是數據庫賬號,GS_PASSWORD參數是數據庫密碼,--restart=always表示隨系統開機啟動。
4.停止OpenGauss
docker stop opengauss
5.啟動OpenGauss
docker start opengauss
6.進入OpenGauss
進入容器
docker exec -it opengauss /bin/bash
切換到超級用戶
su omm
連接OpenGauss
gsql
?可以添加賬號、配置權限等。
退出OpenGauss
\q
退出容器
exit