MariaDB数据库管理系统是MySQL的一个分支,主要由开源社区在维护,采用GPL授权许可 MariaDB的目的是完全兼容MySQL,包括API和命令行,使之能轻松成为MySQL的代替品。
成都创新互联公司是一家集网站建设,潘集企业网站建设,潘集品牌网站建设,网站定制,潘集网站建设报价,网络营销,网络优化,潘集网站推广为一体的创新建站企业,帮助传统企业提升企业形象加强企业竞争力。可充分满足这一群体相比中小企业更为丰富、高端、多元的互联网需求。同时我们时刻保持专业、时尚、前沿,时刻以成就客户成长自我,坚持不断学习、思考、沉淀、净化自己,让我们为更多的企业打造出实用型网站。
root@debian1:~/nginx# docker search mariadb NAME DESCRIPTION STARS OFFICIAL AUTOMATED |
---|
mariadb MariaDB is a community-developed fork of M… 1417 [OK] |
bitnami/mariadb Bitnami MariaDB Docker Image 39 [OK] |
root@debian1:~/nginx# docker pull mariadb |
---|
Using default tag: latest |
latest: Pulling from library/mariadb |
root@debian1:~/nginx# docker run –privileged -d -e TIMEZONE=Asis/Shanghai -e MYSQL_ROOT_PASSWORD=hanye131 -e SERVER_ID=1 -v $PWD/mysql_db:/var/lib/mysql -p 3306:3306 mariadb |
---|
255650e5e83d27402b1df338c09c0639b1512e73ef27cd31e1f2c90509dc104c |
root@debian1:~/nginx# docker ps -a |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
255650e5e83d mariadb “docker-entrypoint…” 3 seconds ago Up 1 second 0.0.0.0:3306->3306/tcp festive_ride |
root@debian1:~/nginx# netstat -tunl|grep 3306 |
---|
tcp6 0 0 :::3306 :::* LISTEN |
root@debian1:~/nginx# mysql -uroot -phanye131 -h127.0.0.1 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 5.5.5-10.2.6-MariaDB-10.2.6+maria~jessie mariadb.org binary distributionCopyright (c) 2000, 2017, 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>
如果提示无法链接找到sock文件,你需要链接到docker的mariadb容器之内来授权链接
获取mariadb的CONTAINER ID
root@debian1:~/nginx# docker ps -a |
---|
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
255650e5e83d mariadb “docker-entrypoint…” 10 minutes ago Up 10 minutes 0.0.0.0:3306->3306/tcp festive_ride 360baf71efb0 a3ae0b27ec04 “/run.sh bash” 3 hours ago Exited (2) 3 hours ago nginx |
我这里的mariadb的镜像的CONTAINER ID是 255650e5e83d
root@debian1:~/nginx# docker exec -it 255650e5e83d bash |
---|
root@255650e5e83d:/# |
MariaDB [(none)]> grant all on . to ‘root’@’192.168.1.%’ identified by ‘hanye131’; Query OK, 0 rows affected (0.01 sec) |
---|
MariaDB [(none)]> flush privileges; Query OK, 0 rows affected (0.01 sec) |
分享标题:Docker构建Mariadb具体步骤
网页链接:http://www.shufengxianlan.com/qtweb/news7/118357.html
网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联