Tag: mysql

Create new user in MySQL and give it full access to one database

I’m new to MySQL administration. I want to create a new user in MySQL and give it full access only to 1 database, say dbTest, that I create. What would be the MySQL commands to do that?

Docker slow non-local database access

We are using Docker for our local development environments, and deploying to Google Cloud Container Engine for production. Our production SQL server is also on Google Cloud. When our container is running on Container Engine, DB access is lightning fast, but is horribly slow when running in our local machines. Some page loads that normally […]

Connection to MySql in Docker-Container fails with Gradle

I’m trying to execute commands in a MySql Docker-Container with Gradle. This is my unsuccessful Gradle Task: task hello(type: Exec) { dependsOn mysqlStartContainer executable “bash” args “-c”, “docker exec mysql mysql -u root -p1234 -e ‘select version();'” } This is the error i get: ERROR 2002 (HY000): Can’t connect to local MySQL server through socket […]

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysql.sock' (2)

I’m getting this error ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysql.sock’ (2) even though I have managed to start mysql via command line in ubuntu mysql stop/waiting mysql start/running, process 17691 However when attempting to access the site I get a database connection error as well as the above error […]

Backing up and restoring mysql database with Laravel/Docker

I’m working on changing my environment from vagrant to docker and I came across one hitch. With vagrant I have a bash file that will pull data from ftp and restore it in my local so that I can work with the most up to date data. This is my code php artisan db:restore –database=mysql […]

Using MySQL in a Docker Container

I am kinda new to Docker and I am trying to build an image for a Django App using MySQL. The problem that I am having is, after running my image I get the following error : django.db.utils.OperationalError: (2002, “Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (111)”) . As a base for the […]

Rails Atomicity problems?

I am getting a lot of very weird problems when using activejob and sidekiq on two separate containers. I am using RDS MySQL as my DB backend. I am experiencing VERY weird non-atomic behavior when loading related records from the job. Example: Models: Shoe & ShoeLace We have a POST that says: make my Shoe […]

Docker Compose – How reference many schemas in one mysql container

I’m trying to use two schemas into one mysql container. I have two flyway services that connect to two different schemas. The .yml file of Docker Compose looks like: version: ‘2’ services: mysqldb: image: mysql:5.6.26 environment: MYSQL_USER: user MYSQL_PASSWORD: password MYSQL_ROOT_PASSWORD: password MYSQL_DATABASE: – my – my_post ports: – “3306:3306” flyway-service1-i: image: mik/flyway-service volumes: – […]

Docker: fail linking with mysql DB

Am trying to connect Mysql container with Piwik ‘php app’ firs i run the mysql container like this: docker run –name piwik -e MYSQL_ROOT_PASSWORD=123456 -d mysql Then am trying to run and link the piwik app with this command: docker run -d -e PIWIK_MYSQL_USER=root -e PIWIK_MYSQL_PASSWORD=123456 -e PIWIK_MYSQL_DBNAME=piwik -e PIWIK_MYSQL_PREFIX=piwik_ –link piwik:piwikmysql –name vpiwik marvambass/piwik […]

Docker container crashes on start: java.net.NoRouteToHostException: No route to host

In recent days, my Docker container (SonarQube) crashes a couple seconds after being started. It seems that it cannot connect the database container anymore. How can I reconnect them together? MySQL container run command: docker run -d –name mysql-sonarqube-container \ -e MYSQL_ROOT_PASSWORD=root \ -p 3307:3306 \ -v /etc/mysql:/etc/mysql/conf.d \ mysql:latest MySQL user creation: use sonar; […]

Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.