sameersbn / docker-mysql

A Dockerfile that installs a mysql server
MIT License
246 stars 174 forks source link

Latest mysql image having issue with gitlab #30

Closed balajidl closed 6 years ago

balajidl commented 6 years ago

@sameersbn and team Kindly have a look at #https://github.com/sameersbn/docker-gitlab/issues/1486 After docker-compose pull, I am getting the following error

mysql_1   | Creating database "gitlabhq_production"...
mysql_1   | Granting access to database "gitlabhq_production" for user "gitlab"...
mysql_1   | ERROR 3009 (HY000) at line 1: Column count of mysql.user is wrong. Expected 45, found 42. Created with MySQL 50554, now running 50721. Please use mysql_upgrade to fix this error.
balajidl commented 6 years ago

Resolved it by using mysql image and then connecting to mysql shell to run the mysql_upgrade

  1. Created one docker-compose for mysql alone.
    
    version: '2'

services:

mysql: restart: always image: mysql volumes:

  1. started it by running docker-compose up
  2. connected to the running instance by using the command docker exex -it <doc ps id for mysql> bash to get shell access
  3. Inside the shell ran mysql_upgrade. It upgraded all tables in mysql
  4. Now copied the same docker-compose to my gitlab docker-compose. (this means, I used mysql image and not sameersbn image)
  5. started docker and gitlab is working fine again