中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

使用docker-compose部署MySQL方法

發布時間:2020-05-18 15:33:48 來源:網絡 閱讀:556 作者:三月 欄目:MySQL數據庫

文主要給大家介紹使用docker-compose部署MySQL方法,文章內容都是筆者用心摘選和編輯的,具有一定的針對性,對大家的參考意義還是比較大的,下面跟筆者一起了解下使用docker-compose部署MySQL方法吧。 

[root@169_test mariadb10.3]# cat docker-compose.yml
version: '2'

services:
db:
image: mytest/mariadb10.3:latest
volumes:

  - ./db_data/:/var/lib/mysql/
restart: always
ports:
  - "3306:3306"

[root@169_test mariadb10.3]# docker-compose up
Creating network "mariadb103_default" with the default driver
Creating mariadb103_db_1 ... done
Attaching to mariadb103_db_1
db_1  | Installing MariaDB/MySQL system tables in '/var/lib/mysql' ...
db_1  | OK
db_1  |
db_1  | To start mysqld at boot time you have to copy
db_1  | support-files/mysql.server to the right place for your system
db_1  |
db_1  |
db_1  | PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
db_1  | To do so, start the server, then issue the following commands:
db_1  |
db_1  | '/usr/bin/mysqladmin' -u root password 'new-password'
db_1  | '/usr/bin/mysqladmin' -u root -h d56fe1b27eb9 password 'new-password'
db_1  |
db_1  | Alternatively you can run:
db_1  | '/usr/bin/mysql_secure_installation'
db_1  |
db_1  | which will also give you the option of removing the test
db_1  | databases and anonymous user created by default.  This is
db_1  | strongly recommended for production servers.
db_1  |
db_1  | See the MariaDB Knowledgebase at http://mariadb.com/kb or the
db_1  | MySQL manual for more instructions.
db_1  |
db_1  | You can start the MariaDB daemon with:
db_1  | cd '/usr' ; /usr/bin/mysqld_safe --datadir='/var/lib/mysql'
db_1  |
db_1  | You can test the MariaDB daemon with mysql-test-run.pl
db_1  | cd '/usr/mysql-test' ; perl mysql-test-run.pl
db_1  |
db_1  | Please report any problems at http://mariadb.org/jira
db_1  |
db_1  | The latest information about MariaDB is available at http://mariadb.org/.
db_1  | You can find additional information about the MySQL part at:
db_1  | http://dev.mysql.com
db_1  | Consider joining MariaDB's strong and vibrant community:
db_1  | https://mariadb.org/get-involved/
db_1  |
db_1  | Starting MariaDB.190611 03:38:08 mysqld_safe Logging to '/var/lib/mysql/d56fe1b27eb9.err'.
db_1  | 190611 03:38:08 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
db_1  |  SUCCESS!

^CGracefully stopping... (press Ctrl+C again to force)
Stopping mariadb103_db_1 ...
Killing mariadb103_db_1 ... done
[root@169_test mariadb10.3]# ^C
[root@169_test mariadb10.3]# docker ps -a
CONTAINER ID        IMAGE                       COMMAND                  CREATED             STATUS                       PORTS                    NAMES
d56fe1b27eb9        mytest/mariadb10.3:latest   "/run.sh"                27 seconds ago      Exited (137) 7 seconds ago                            mariadb103_db_1
762ed1f53368        registry:2                  "/entrypoint.sh /etc…"   2 hours ago         Up 2 hours                   0.0.0.0:5000->5000/tcp   registry
[root@169_test mariadb10.3]# docker rm d
d
[root@169_test mariadb10.3]# docker-compose up  -d
Creating mariadb103_db_1 ... done

[root@169_test mariadb10.3]# mysql  -h227.0.0.1 -uroot -P3306 -p123456
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 14
Server version: 5.5.5-10.3.15-MariaDB MariaDB Server

Copyright (c) 2000, 2019, 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> select @@version;
+-----------------+
| @@version       |
+-----------------+
| 10.3.15-MariaDB |
+-----------------+
1 row in set (0.00 sec)

mysql>

看完以上關于使用docker-compose部署MySQL方法,很多讀者朋友肯定多少有一定的了解,如需獲取更多的行業知識信息 ,可以持續關注我們的行業資訊欄目的。

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

武宣县| 鲜城| 宜章县| 明溪县| 秦皇岛市| 安乡县| 边坝县| 邵武市| 望江县| 桦甸市| 雷波县| 郑州市| 罗甸县| 镇赉县| 广元市| 乾安县| 孝昌县| 青龙| 济宁市| 永靖县| 正定县| 田阳县| 大城县| 梅河口市| 南阳市| 雅安市| 米易县| 上思县| 遂溪县| 驻马店市| 新干县| 莱芜市| 桂阳县| 沭阳县| 满洲里市| 准格尔旗| 鄂伦春自治旗| 余江县| 山阳县| 丘北县| 莱西市|