yobasystems / alpine-mariadb

MariaDB running on Alpine Linux [Docker]
https://hub.docker.com/r/yobasystems/alpine-mariadb/
242 stars 72 forks source link

[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist #27

Closed demyxco closed 5 years ago

demyxco commented 5 years ago

Error appears on two different machines when doing a fresh run. Looks like it fails to create the initial databases.

# From your Docker Hub page
docker run -it --rm --name mysql -p 3306:3306 -v /home/user/mysql:/var/lib/mysql -e MYSQL_DATABASE=wordpressdb -e MYSQL_USER=wordpressuser -e MYSQL_PASSWORD=hguyFt6S95dgfR4ryb -e MYSQL_ROOT_PASSWORD=hguyFtgfR4r9R4r76 yobasystems/alpine-mariadb
[i] mysqld not found, creating....
[i] MySQL data directory not found, creating initial DBs
[i] Creating database: wordpressdb
[i] Creating user: wordpressuser with password hguyFt6S95dgfR4ryb
2019-03-01  7:34:22 0 [Note] /usr/bin/mysqld (mysqld 10.3.13-MariaDB) starting as process 66 ...
2019-03-01  7:34:22 0 [Note] InnoDB: Using Linux native AIO
2019-03-01  7:34:22 0 [Note] InnoDB: The first innodb_system data file 'ibdata1' did not exist. A new tablespace will be created!
2019-03-01  7:34:22 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-03-01  7:34:22 0 [Note] InnoDB: Uses event mutexes
2019-03-01  7:34:22 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-03-01  7:34:22 0 [Note] InnoDB: Number of pools: 1
2019-03-01  7:34:22 0 [Note] InnoDB: Using SSE2 crc32 instructions
2019-03-01  7:34:22 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2019-03-01  7:34:22 0 [Note] InnoDB: Completed initialization of buffer pool
2019-03-01  7:34:22 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2019-03-01  7:34:22 0 [Note] InnoDB: Setting file './ibdata1' size to 12 MB. Physically writing the file full; Please wait ...
2019-03-01  7:34:22 0 [Note] InnoDB: File './ibdata1' size is now 12 MB.
2019-03-01  7:34:22 0 [Note] InnoDB: Setting log file ./ib_logfile101 size to 50331648 bytes
2019-03-01  7:34:22 0 [Note] InnoDB: Setting log file ./ib_logfile1 size to 50331648 bytes
2019-03-01  7:34:22 0 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2019-03-01  7:34:22 0 [Note] InnoDB: New log files created, LSN=45786
2019-03-01  7:34:22 0 [Note] InnoDB: Doublewrite buffer not found: creating new
2019-03-01  7:34:22 0 [Note] InnoDB: Doublewrite buffer created
2019-03-01  7:34:22 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2019-03-01  7:34:22 0 [Note] InnoDB: Creating foreign key constraint system tables.
2019-03-01  7:34:22 0 [Note] InnoDB: Creating tablespace and datafile system tables.
2019-03-01  7:34:22 0 [Note] InnoDB: Creating sys_virtual system tables.
2019-03-01  7:34:22 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2019-03-01  7:34:22 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2019-03-01  7:34:22 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2019-03-01  7:34:22 0 [Note] InnoDB: Waiting for purge to start
2019-03-01  7:34:22 0 [Note] InnoDB: 10.3.13 started; log sequence number 0; transaction id 7
2019-03-01  7:34:22 0 [Note] Plugin 'FEEDBACK' is disabled.
ERROR: 1049  Unknown database 'mysql'
2019-03-01  7:34:22 0 [ERROR] Aborting

/scripts/run.sh: ignoring or entrypoint initdb empty /docker-entrypoint-initdb.d/*

MySQL init process done. Ready for start up.

exec /usr/bin/mysqld --user=mysql --console --skip-name-resolve --skip-networking=0
2019-03-01  7:34:24 0 [Note] /usr/bin/mysqld (mysqld 10.3.13-MariaDB) starting as process 1 ...
2019-03-01  7:34:24 0 [Note] InnoDB: Using Linux native AIO
2019-03-01  7:34:24 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-03-01  7:34:24 0 [Note] InnoDB: Uses event mutexes
2019-03-01  7:34:24 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-03-01  7:34:24 0 [Note] InnoDB: Number of pools: 1
2019-03-01  7:34:24 0 [Note] InnoDB: Using SSE2 crc32 instructions
2019-03-01  7:34:24 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2019-03-01  7:34:24 0 [Note] InnoDB: Completed initialization of buffer pool
2019-03-01  7:34:24 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2019-03-01  7:34:24 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2019-03-01  7:34:24 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2019-03-01  7:34:24 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2019-03-01  7:34:24 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2019-03-01  7:34:24 0 [Note] InnoDB: Waiting for purge to start
2019-03-01  7:34:24 0 [Note] InnoDB: 10.3.13 started; log sequence number 1603959; transaction id 9
2019-03-01  7:34:24 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2019-03-01  7:34:24 0 [Note] InnoDB: Buffer pool(s) load completed at 190301  7:34:24
2019-03-01  7:34:24 0 [Note] Plugin 'FEEDBACK' is disabled.
2019-03-01  7:34:24 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2019-03-01  7:34:24 0 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
2019-03-01  7:34:24 0 [Note] Server socket created on IP: '::'.
2019-03-01  7:34:24 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
bvm84 commented 5 years ago

The same error. It seems issue appears after mariadb update to 10.3.13. Error confirm both on native Ubuntu 18.04 and Ubuntu 18.04 in VmWare.

Docker info output: Containers: 8 Running: 3 Paused: 0 Stopped: 5 Images: 117 Server Version: 18.06.1-ce Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Native Overlay Diff: true Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: bridge host macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog Swarm: inactive Runtimes: runc Default Runtime: runc Init Binary: docker-init containerd version: (expected: 468a545b9edcd5932818eb9de8e72413e616e86e) runc version: N/A (expected: 69663f0bd4b60df09991c08812a60108003fa340) init version: v0.18.0 (expected: fec3683b971d9c3ef73f284f176672c44b448662) Security Options: apparmor seccomp Profile: default Kernel Version: 4.15.0-46-generic Operating System: Ubuntu 18.04.2 LTS OSType: linux Architecture: x86_64 CPUs: 4 Total Memory: 3.83GiB Name: bubuntu_dev ID: UAJF:RLCN:QZPW:CIQI:CVUQ:OKRR:OJZF:CIFV:SNOE:WVOK:5ZFG:7EHJ Docker Root Dir: /var/lib/docker Debug Mode (client): false Debug Mode (server): false Username: *** Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false

demyxco commented 5 years ago

I noticed a mysql folder is created at my user's home, inside it some mysql content owned by root.

stevoh6 commented 5 years ago

I think there is missing flag --ldata, see: https://stackoverflow.com/a/22179751

Pull reuest created: https://github.com/yobasystems/alpine-mariadb/pull/28

bvm84 commented 5 years ago

--ldata fix the problem. Thanks.

demyxco commented 5 years ago

Case closed.

dominictayloruk commented 5 years ago

Thanks.