Docker MariaDB Container无法导入数据

时间:2017-10-31 17:47:16

标签: mysql ubuntu docker docker-compose macos-sierra

我在macbook上运行docker-compose.yml时遇到问题(macOS 10x - 8GB - 2.4 GHZ)。一切正常,直到docker-entrypoint.sh想要导入我给的DB(900MB Mysql转储)。

sw_mysql_1  | ERROR 2013 (HY000) at line 337: Lost connection to MySQL server during query

这个确切的项目在我的桌面上运行得很好(Intel Quad 3.7 GHZ + 16GB RAM)。这是硬件问题还是软件(MAC或Ubuntu上的Docker)?

2 个答案:

答案 0 :(得分:1)

Docker RAM Setup

我找到了解决方案 - 显然,Docker for MAC使用不同的设置或者这台计算机上给定RAM的百分比不够。

查看图片,将1GB转储设置为4GB似乎可以正常工作。

答案 1 :(得分:0)

检查是否有一些大的插入语句大于docker容器中设置的最大大小。

MySQL启动配置在容器的文件// no interpolation yet // cv::Vec3b only cv::Mat shear(const cv::Mat & input, float Bx, float By) { if (Bx*By == 1) { throw("Shearing: Bx*By==1 is forbidden"); } if (input.type() != CV_8UC3) return cv::Mat(); // shearing: // x'=x+y·Bx // y'=y+x*By // shear the extreme positions to find out new image size: std::vector<cv::Point2f> extremePoints; extremePoints.push_back(cv::Point2f(0, 0)); extremePoints.push_back(cv::Point2f(input.cols, 0)); extremePoints.push_back(cv::Point2f(input.cols, input.rows)); extremePoints.push_back(cv::Point2f(0, input.rows)); for (unsigned int i = 0; i < extremePoints.size(); ++i) { cv::Point2f & pt = extremePoints[i]; pt = cv::Point2f(pt.x + pt.y*Bx, pt.y + pt.x*By); } cv::Rect offsets = cv::boundingRect(extremePoints); cv::Point2f offset = -offsets.tl(); cv::Size resultSize = offsets.size(); cv::Mat shearedImage = cv::Mat::zeros(resultSize, input.type()); // every pixel here is implicitely shifted by "offset" // perform the shearing by back-transformation for (int j = 0; j < shearedImage.rows; ++j) { for (int i = 0; i < shearedImage.cols; ++i) { cv::Point2f pp(i, j); pp = pp - offset; // go back to original coordinate system // go back to original pixel: // x'=x+y·Bx // y'=y+x*By // y = y'-x*By // x = x' -(y'-x*By)*Bx // x = +x*By*Bx - y'*Bx +x' // x*(1-By*Bx) = -y'*Bx +x' // x = (-y'*Bx +x')/(1-By*Bx) cv::Point2f p; p.x = (-pp.y*Bx + pp.x) / (1 - By*Bx); p.y = pp.y - p.x*By; if ((p.x >= 0 && p.x < input.cols) && (p.y >= 0 && p.y < input.rows)) { // TODO: interpolate, if wanted (p is floating point precision and can be placed between two pixels)! shearedImage.at<cv::Vec3b>(j, i) = input.at<cv::Vec3b>(p); } } } return shearedImage; } int main(int argc, char* argv[]) { cv::Mat input = cv::imread("C:/StackOverflow/Input/Lenna.png"); cv::Mat output = shear(input, 0.7, 0); //cv::Mat output = shear(input, -0.7, 0); //cv::Mat output = shear(input, 0, 0.7); cv::imshow("input", input); cv::imshow("output", output); cv::waitKey(0); return 0; } 中指定。

尝试将本地配置模仿到docker的配置中,以防出现任何差异。