欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

Macosx下使用docker/mysql會出現(xiàn)什么問題

這篇文章主要為大家展示了“Macosx下使用docker/MySQL會出現(xiàn)什么問題”,內(nèi)容簡而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領(lǐng)大家一起研究并學(xué)習(xí)一下“Macosx下使用docker/mysql會出現(xiàn)什么問題”這篇文章吧。

專業(yè)成都網(wǎng)站建設(shè)公司,做排名好的好網(wǎng)站,排在同行前面,為您帶來客戶和效益!成都創(chuàng)新互聯(lián)為您提供成都網(wǎng)站建設(shè),五站合一網(wǎng)站設(shè)計制作,服務(wù)好的網(wǎng)站設(shè)計公司,成都做網(wǎng)站、成都網(wǎng)站建設(shè)負責任的成都網(wǎng)站制作公司!

問題描述

在macosx下如果指定本地目錄替換/var/lib/mysql,運行時會出現(xiàn)文件權(quán)限的錯誤,導(dǎo)致mysqld無法正常運行

Creating mysql_test-mysql_1
Attaching to mysql_test-mysql_1
test-mysql_1 | Initializing database
test-mysql_1 | 2016-03-23T04:32:37.437789Z 0 [Warning] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
test-mysql_1 | 2016-03-23T04:32:37.466955Z 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
test-mysql_1 | 2016-03-23T04:32:37.467828Z 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
test-mysql_1 | 2016-03-23T04:32:37.468824Z 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
test-mysql_1 | 2016-03-23T04:32:37.468912Z 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
test-mysql_1 | 2016-03-23T04:32:37.470280Z 0 [ERROR] InnoDB: Cannot open datafile './ibdata1'
test-mysql_1 | 2016-03-23T04:32:37.470309Z 0 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
test-mysql_1 | 2016-03-23T04:32:37.470317Z 0 [ERROR] InnoDB: InnoDB Database creation was aborted with error Cannot open a file. You may need to delete the ibdata1 file before trying to start up again.
test-mysql_1 | 2016-03-23T04:32:38.073222Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
test-mysql_1 | 2016-03-23T04:32:38.073268Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
test-mysql_1 | 2016-03-23T04:32:38.073283Z 0 [ERROR] Failed to initialize plugins.
test-mysql_1 | 2016-03-23T04:32:38.073289Z 0 [ERROR] Aborting
test-mysql_1 | 
mysql_test-mysql_1 exited with code 1

解決方案

  • 創(chuàng)建在scripts目錄下mysqld啟動腳本

#!/bin/bash
# From https://github.com/docker-library/mysql/issues/99
set -e # fail on any error

echo '* Working around permission errors in Docker on Mac locally by making sure that "mysql" uses the same uid and gid as the host volume'
TARGET_UID=$(stat -c "%u" /var/lib/mysql)
echo '-- Setting mysql user to use uid '$TARGET_UID
usermod -o -u $TARGET_UID mysql || true
TARGET_GID=$(stat -c "%g" /var/lib/mysql)
echo '-- Setting mysql group to use gid '$TARGET_GID
groupmod -o -g $TARGET_GID mysql || true
echo
echo '* Starting MySQL'
chown -R mysql:root /var/run/mysqld/
/entrypoint.sh mysqld --user=mysql --console
  • 創(chuàng)建docker-compose.py,指定run-mysqld.sh腳本為容器入口

test-mysql:
    image: mysql 
    ports:
        - "3306:3306"
    volumes:   
        - /localhost/mysql/data:/var/lib/mysql 
        - ./scripts/run-mysqld.sh:/run-mysqld.sh
    environment:
        - MYSQL_DATABASE=play
        - MYSQL_USER=play
        - MYSQL_PASSWORD=play
        - MYSQL_ROOT_PASSWORD=123456
    entrypoint: /run-mysqld.sh
  • 運行docker-compose up命令,啟動容器

以上是“Macosx下使用docker/mysql會出現(xiàn)什么問題”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對大家有所幫助,如果還想學(xué)習(xí)更多知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!

分享標題:Macosx下使用docker/mysql會出現(xiàn)什么問題
分享URL:http://www.aaarwkj.com/article8/gdgoop.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供外貿(mào)網(wǎng)站建設(shè)、微信公眾號品牌網(wǎng)站建設(shè)、網(wǎng)站排名、定制網(wǎng)站、網(wǎng)站改版

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

綿陽服務(wù)器托管
偷怕自拍在线免费观看| 日本在线一区二区三区免费视频| 欧美成人精品高清在线| 久草视频免费福利观看| 日本高清不卡免费在线观看视频一二三区| 免费观看黄片视频在线观看| 三级日本午夜在线观看| 夜夜春国产精品不卡一区二区 | 中文字幕国产精品91| 日韩二区三区精品视频| 日本电影在线看一区二区| 午夜亚洲欧美日韩在线| 午夜在线成人免费观看| 亚洲人午夜射精精品日韩| 少妇太爽高潮在线播放| 国产毛片精品一区内射| 国产在线拍揄自揄视频不卡99| 视频一区二区三区拍拍| 日本熟熟妇丰满人妻啪啪| 夫妻性生活短是什么原因| 日韩看片一区二区三区高清| 成人亚洲精品一区二区三区| 日本黄色录像黄色录像| 欧美日韩一区二区三区色拉拉| 中文字幕久久亚洲一区| 亚洲中国av一区二区| 国产精品播放一区二区三区| 永久黄区观看在线网址| 亚洲第一区二区国产精品| 扒开少妇毛茸茸的大荫萍蒂| 国产视频不卡一区二区| 成人av男人天堂东京热| 国产二区日韩成人精品| 蜜桃午夜精品一区二区三区| 在线观看日韩精品电影| 韩国av一区二区三区| 欧美亚洲国产另类第一页| 欧美日韩av在线一区二区| 日韩久久精品五月综合| 日本午夜视频在线观看| 亚洲成人国产一区二区|