mamp mysql won't start - mysql

I have problem with mysql server. When I start MAMP Mysql server won't start. I tried to change port but it didn't help. I check the error log where I find this:
161010 09:21:07 mysqld_safe Starting mysqld daemon with databases from /Applications/MAMP/db/mysql56
2016-10-10 09:21:07 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-10-10 09:21:07 0 [Note] /Applications/MAMP/Library/bin/mysqld (mysqld 5.6.28) starting as process 6633 ...
2016-10-10 09:21:07 6633 [Warning] Setting lower_case_table_names=2 because file system for /Applications/MAMP/db/mysql56/ is case insensitive
2016-10-10 09:21:07 6633 [Note] Plugin 'FEDERATED' is disabled.
/Applications/MAMP/Library/bin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13 - Permission denied)
2016-10-10 09:21:07 6633 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2016-10-10 09:21:07 6633 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-10-10 09:21:07 6633 [Note] InnoDB: The InnoDB memory heap is disabled
2016-10-10 09:21:07 6633 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-10-10 09:21:07 6633 [Note] InnoDB: Memory barrier is not used
2016-10-10 09:21:07 6633 [Note] InnoDB: Compressed tables use zlib 1.2.8
2016-10-10 09:21:07 6633 [Note] InnoDB: Using CPU crc32 instructions
2016-10-10 09:21:07 6633 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-10-10 09:21:07 6633 [Note] InnoDB: Completed initialization of buffer pool
2016-10-10 09:21:07 6633 [Note] InnoDB: Highest supported file format is Barracuda.
2016-10-10 09:21:07 6633 [Note] InnoDB: 128 rollback segment(s) are active.
2016-10-10 09:21:07 6633 [Note] InnoDB: Waiting for purge to start
2016-10-10 09:21:07 6633 [Note] InnoDB: 5.6.28 started; log sequence number 1600617
2016-10-10 09:21:07 6633 [Note] RSA private key file not found: /Applications/MAMP/db/mysql56//private_key.pem. Some authentication plugins will not work.
2016-10-10 09:21:07 6633 [Note] RSA public key file not found: /Applications/MAMP/db/mysql56//public_key.pem. Some authentication plugins will not work.
2016-10-10 09:21:07 6633 [Note] Server hostname (bind-address): '*'; port: 3308
2016-10-10 09:21:07 6633 [Note] IPv6 is available.
2016-10-10 09:21:07 6633 [Note] - '::' resolves to '::';
2016-10-10 09:21:07 6633 [Note] Server socket created on IP: '::'.
2016-10-10 09:21:07 6633 [ERROR] /Applications/MAMP/Library/bin/mysqld: Can't find file: './mysql/user.frm' (errno: 13 - Permission denied)
2016-10-10 09:21:07 6633 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/user.frm' (errno: 13 - Permission denied)
161010 09:21:07 mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended
I hope someone can help me how to solve this problem.

I don't know if this will be your problem, but I tried killing mysqld with killall -9 mysqld and tried looking for mysqld running in Activity Monitor, but it wasn't there.
Eventually I worked it out: What had happened before the problem for me was that a mysqldump had been interrupted. That had corrupted a tablespace. So I quit and restarted MAMP PRO (servers are not set to auto start). Then changed my.cnf using MAMPs File > Edit template. And added the line innodb_force_recovery = 1. The servers started fine after that. I commented out that line after the fix.

Rename all files ib_logfileN (N being the number) from the MAMP/db/mysql56 folder.
mv tmp_ib_logfileN
Then restart MAMP.
Enjoyed

Related

MySQL docker: Import schema file with error: inet addr:'| cut -d: -f2 | awk '{ print $1}'", "commandName": "IP"}], "clamAvInt'

I am working with MySQL docker image version 5.7 with initialize the data by the schema file but got some error can't solve.
My docker command line is:
docker run --name mysql -e MYSQL_ROOT_PASSWORD='abc123' -v /Users/jenkins/Desktop/irms:/docker-entrypoint-initdb.d mysql:5.7
and get the error, the log as below:
$ docker run --name mysql -e MYSQL_ROOT_PASSWORD='abc123' -v /Users/jenkins/Desktop/irms:/docker-entrypoint-initdb.d mysql:5.7
2021-03-17 02:05:15+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.33-1debian10 started.
2021-03-17 02:05:15+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2021-03-17 02:05:15+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.33-1debian10 started.
2021-03-17 02:05:15+00:00 [Note] [Entrypoint]: Initializing database files
2021-03-17T02:05:15.606058Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-03-17T02:05:15.756090Z 0 [Warning] InnoDB: New log files created, LSN=45790
2021-03-17T02:05:15.779384Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2021-03-17T02:05:15.837663Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 373d4ffb-86c5-11eb-8780-0242ac110002.
2021-03-17T02:05:15.839186Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2021-03-17T02:05:16.450734Z 0 [Warning] CA certificate ca.pem is self signed.
2021-03-17T02:05:16.576740Z 1 [Warning] root#localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2021-03-17 02:05:18+00:00 [Note] [Entrypoint]: Database files initialized
2021-03-17 02:05:18+00:00 [Note] [Entrypoint]: Starting temporary server
2021-03-17 02:05:18+00:00 [Note] [Entrypoint]: Waiting for server startup
2021-03-17T02:05:18.819727Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-03-17T02:05:18.820623Z 0 [Note] mysqld (mysqld 5.7.33) starting as process 78 ...
2021-03-17T02:05:18.822725Z 0 [Note] InnoDB: PUNCH HOLE support available
2021-03-17T02:05:18.822772Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-03-17T02:05:18.822783Z 0 [Note] InnoDB: Uses event mutexes
2021-03-17T02:05:18.822789Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2021-03-17T02:05:18.822795Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-03-17T02:05:18.822800Z 0 [Note] InnoDB: Using Linux native AIO
2021-03-17T02:05:18.823072Z 0 [Note] InnoDB: Number of pools: 1
2021-03-17T02:05:18.823301Z 0 [Note] InnoDB: Using CPU crc32 instructions
2021-03-17T02:05:18.824551Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2021-03-17T02:05:18.829149Z 0 [Note] InnoDB: Completed initialization of buffer pool
2021-03-17T02:05:18.830692Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2021-03-17T02:05:18.841912Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2021-03-17T02:05:18.846985Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-03-17T02:05:18.847098Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-03-17T02:05:18.862891Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2021-03-17T02:05:18.863475Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2021-03-17T02:05:18.863521Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2021-03-17T02:05:18.863960Z 0 [Note] InnoDB: Waiting for purge to start
2021-03-17T02:05:18.914486Z 0 [Note] InnoDB: 5.7.33 started; log sequence number 2746831
2021-03-17T02:05:18.915203Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2021-03-17T02:05:18.915523Z 0 [Note] Plugin 'FEDERATED' is disabled.
2021-03-17T02:05:18.916967Z 0 [Note] InnoDB: Buffer pool(s) load completed at 210317 2:05:18
2021-03-17T02:05:18.920098Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2021-03-17T02:05:18.920168Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2021-03-17T02:05:18.920570Z 0 [Warning] CA certificate ca.pem is self signed.
2021-03-17T02:05:18.920635Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2021-03-17T02:05:18.922497Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2021-03-17T02:05:18.926990Z 0 [Note] Event Scheduler: Loaded 0 events
2021-03-17T02:05:18.927219Z 0 [Note] mysqld: ready for connections.
Version: '5.7.33' socket: '/var/run/mysqld/mysqld.sock' port: 0 MySQL Community Server (GPL)
2021-03-17 02:05:19+00:00 [Note] [Entrypoint]: Temporary server started.
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.
2021-03-17 02:05:20+00:00 [Note] [Entrypoint]: /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/IRMSDB_2021-03-09.sql
ERROR 1064 (42000) at line 287: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inet addr:'| cut -d: -f2 | awk '{ print $1}'", "commandName": "IP"}], "clamAvInt' at line 5
I checked my schema file and no idea what the error exactly and no idea how to fix it.
My schema file is exported from Sequel Pro.
Could you kindly provide some idea to solve the problem?
Thanks very much.
Just attached my schema file below, and please change the extension name from jpg to SQL.
Click here to download: MySQL schema file

How to access db [Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'root'#'172.18.0.3' (using password: YES)] in docker container

I have the following docker-compose.yml file.
I would like to buildthem and connect to DB
version: '3'
services:
api-server:
build: ./api
links:
- 'db'
ports:
- '3000:3000'
volumes:
- ./api:/src
- ./src/node_modules
tty: true
container_name: api-server
db:
build:
context: .
dockerfile: ./db/Dockerfile
restart: always
hostname: db
environment:
MYSQL_ROOT_PASSWORD: test
MYSQL_USER: root
MYSQL_PASSWORD: test
MYSQL_DATABASE: db
volumes:
- './db:/config'
ports:
- 3306:3306
container_name: db
After docker-compose build
then docker-compose up -d
And then `docker exec -it api-server sh'
I could enter containers. and tried
yarn ts-node node_modules/.bin/typeorm migration:show
typeorm command which connect to DB
But it returned
Error during migration show: Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'root'#'172.18.0.3' (using password: YES)
Are there any way to fix it?
Where is the wrong point of it ?
Thanks
Here is docker logs db
docker logs db
2020-09-15 11:57:44+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.31-1debian10 started.
2020-09-15 11:57:44+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2020-09-15 11:57:44+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.31-1debian10 started.
2020-09-15 11:57:44+00:00 [Note] [Entrypoint]: Initializing database files
2020-09-15T11:57:44.868762Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2020-09-15T11:57:46.939481Z 0 [Warning] InnoDB: New log files created, LSN=45790
2020-09-15T11:57:47.252278Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2020-09-15T11:57:47.327831Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: abfbf3cb-f74a-11ea-bfe8-0242ac120002.
2020-09-15T11:57:47.331570Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2020-09-15T11:57:48.443477Z 0 [Warning] CA certificate ca.pem is self signed.
2020-09-15T11:57:48.733702Z 1 [Warning] root#localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2020-09-15 11:57:52+00:00 [Note] [Entrypoint]: Database files initialized
2020-09-15 11:57:52+00:00 [Note] [Entrypoint]: Starting temporary server
2020-09-15 11:57:52+00:00 [Note] [Entrypoint]: Waiting for server startup
2020-09-15T11:57:52.490209Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2020-09-15T11:57:52.492212Z 0 [Note] mysqld (mysqld 5.7.31) starting as process 77 ...
2020-09-15T11:57:52.497001Z 0 [Note] InnoDB: PUNCH HOLE support available
2020-09-15T11:57:52.497114Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-09-15T11:57:52.497223Z 0 [Note] InnoDB: Uses event mutexes
2020-09-15T11:57:52.497332Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2020-09-15T11:57:52.497452Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-09-15T11:57:52.497542Z 0 [Note] InnoDB: Using Linux native AIO
2020-09-15T11:57:52.498106Z 0 [Note] InnoDB: Number of pools: 1
2020-09-15T11:57:52.498434Z 0 [Note] InnoDB: Using CPU crc32 instructions
2020-09-15T11:57:52.501015Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2020-09-15T11:57:52.515593Z 0 [Note] InnoDB: Completed initialization of buffer pool
2020-09-15T11:57:52.518852Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-09-15T11:57:52.531163Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2020-09-15T11:57:52.555422Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-09-15T11:57:52.555698Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-09-15T11:57:52.665854Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-09-15T11:57:52.667159Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2020-09-15T11:57:52.667286Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2020-09-15T11:57:52.668320Z 0 [Note] InnoDB: 5.7.31 started; log sequence number 2720554
2020-09-15T11:57:52.669761Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2020-09-15T11:57:52.669911Z 0 [Note] Plugin 'FEDERATED' is disabled.
2020-09-15T11:57:52.672485Z 0 [Note] InnoDB: Buffer pool(s) load completed at 200915 11:57:52
2020-09-15T11:57:52.683725Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2020-09-15T11:57:52.683951Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2020-09-15T11:57:52.684864Z 0 [Warning] CA certificate ca.pem is self signed.
2020-09-15T11:57:52.684970Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2020-09-15T11:57:52.687815Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2020-09-15T11:57:52.704435Z 0 [Note] Event Scheduler: Loaded 0 events
2020-09-15T11:57:52.705512Z 0 [Note] mysqld: ready for connections.
Version: '5.7.31' socket: '/var/run/mysqld/mysqld.sock' port: 0 MySQL Community Server (GPL)
2020-09-15 11:57:53+00:00 [Note] [Entrypoint]: Temporary server started.
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.
2020-09-15 11:58:00+00:00 [Note] [Entrypoint]: Creating database mogucare_db
2020-09-15 11:58:00+00:00 [Note] [Entrypoint]: Creating user root
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'root'#'%'
2020-09-15 11:58:02+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.31-1debian10 started.
2020-09-15 11:58:03+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2020-09-15 11:58:03+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.31-1debian10 started.
2020-09-15T11:58:03.406842Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2020-09-15T11:58:03.409690Z 0 [Note] mysqld (mysqld 5.7.31) starting as process 1 ...
2020-09-15T11:58:03.418038Z 0 [Note] InnoDB: PUNCH HOLE support available
2020-09-15T11:58:03.418101Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-09-15T11:58:03.418117Z 0 [Note] InnoDB: Uses event mutexes
2020-09-15T11:58:03.418133Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2020-09-15T11:58:03.418152Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-09-15T11:58:03.418170Z 0 [Note] InnoDB: Using Linux native AIO
2020-09-15T11:58:03.419647Z 0 [Note] InnoDB: Number of pools: 1
2020-09-15T11:58:03.420784Z 0 [Note] InnoDB: Using CPU crc32 instructions
2020-09-15T11:58:03.425652Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2020-09-15T11:58:03.448462Z 0 [Note] InnoDB: Completed initialization of buffer pool
2020-09-15T11:58:03.457474Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-09-15T11:58:03.473399Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2020-09-15T11:58:03.477057Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 2720554
2020-09-15T11:58:03.737975Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 7963136
2020-09-15T11:58:03.934900Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 12578409
2020-09-15T11:58:03.936536Z 0 [Note] InnoDB: Database was not shutdown normally!
2020-09-15T11:58:03.936685Z 0 [Note] InnoDB: Starting crash recovery.
2020-09-15T11:58:04.147681Z 0 [Note] InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percent: 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
2020-09-15T11:58:05.179148Z 0 [Note] InnoDB: Apply batch completed
2020-09-15T11:58:05.286743Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2020-09-15T11:58:05.286809Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-09-15T11:58:05.286925Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-09-15T11:58:05.374586Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-09-15T11:58:05.376546Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2020-09-15T11:58:05.377004Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2020-09-15T11:58:05.378022Z 0 [Note] InnoDB: Waiting for purge to start
2020-09-15T11:58:05.439607Z 0 [Note] InnoDB: 5.7.31 started; log sequence number 12578409
2020-09-15T11:58:05.442005Z 0 [Note] Plugin 'FEDERATED' is disabled.
2020-09-15T11:58:05.454028Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2020-09-15T11:58:05.492756Z 0 [Note] InnoDB: Buffer pool(s) load completed at 200915 11:58:05
2020-09-15T11:58:05.518753Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2020-09-15T11:58:05.518785Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2020-09-15T11:58:05.519497Z 0 [Warning] CA certificate ca.pem is self signed.
2020-09-15T11:58:05.519541Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2020-09-15T11:58:05.536601Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2020-09-15T11:58:05.537666Z 0 [Note] IPv6 is available.
2020-09-15T11:58:05.537947Z 0 [Note] - '::' resolves to '::';
2020-09-15T11:58:05.538239Z 0 [Note] Server socket created on IP: '::'.
2020-09-15T11:58:05.552491Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2020-09-15T11:58:05.574297Z 0 [Note] Event Scheduler: Loaded 0 events
2020-09-15T11:58:05.574997Z 0 [Note] mysqld: ready for connections.
Version: '5.7.31' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL)
2020-09-15T11:59:47.472547Z 3 [Note] Access denied for user 'root'#'172.18.0.3' (using password: YES)
2020-09-15T12:03:15.760923Z 4 [Note] Access denied for user 'root'#'172.18.0.3' (using password: YES)
The reason is in MySQL database mysql, table users. The user you are connecting with doesn't have permission - either because it doesn't exist, you have the wrong password, or you have no rights to connect from your IP to the target database.
In many cases, MySQL docker containers come configured to only allow connections to localhost (127.0.0.1) which means you must either (a) use port forwarding or (b) grant the user permission to connect from anywhere (i.e. %). Sometimes there is also a configuration switch that will automatically do this for you - read the documentation for your db container.

Mgt Development Environment - MySQL suddenly won't start

I have 4 containers using mgt-commerce/mgt-development-environment-7.2. Basically everything runs well until I cannot access the control panel. It returns 500.
After checking the services, logs, etc, it seems like mysql is unable to start. Here is the error log captured in /var/log/mysql/error.log during starting mysql service using sudo service mysql start.
2019-09-26T23:38:43.740283Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2019-09-26T23:38:43.921450Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.26-29) starting as process 1576 ...
2019-09-26T23:38:43.924613Z 0 [Note] InnoDB: PUNCH HOLE support available
2019-09-26T23:38:43.924635Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-09-26T23:38:43.924639Z 0 [Note] InnoDB: Uses event mutexes
2019-09-26T23:38:43.924642Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2019-09-26T23:38:43.924644Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-09-26T23:38:43.924647Z 0 [Note] InnoDB: Using Linux native AIO
2019-09-26T23:38:43.924859Z 0 [Note] InnoDB: Number of pools: 1
2019-09-26T23:38:43.924920Z 0 [Note] InnoDB: Using CPU crc32 instructions
2019-09-26T23:38:43.925849Z 0 [Note] InnoDB: Initializing buffer pool, total size = 1G, instances = 8, chunk size = 128M
2019-09-26T23:38:43.946744Z 0 [Note] InnoDB: Completed initialization of buffer pool
2019-09-26T23:38:43.955252Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2019-09-26T23:38:43.966654Z 0 [Note] InnoDB: Recovering partial pages from the parallel doublewrite buffer at /var/lib/mysql/xb_doublewrite
2019-09-26T23:38:44.033822Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2019-09-26T23:38:44.033986Z 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2019-09-26T23:38:44.034023Z 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2019-09-26T23:38:44.034040Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2019-09-26T23:38:45.135220Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2019-09-26T23:38:45.135270Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2019-09-26T23:38:45.135283Z 0 [ERROR] Failed to initialize builtin plugins.
2019-09-26T23:38:45.135291Z 0 [ERROR] Aborting
2019-09-26T23:38:45.135301Z 0 [Note] Binlog end
2019-09-26T23:38:45.135371Z 0 [Note] Shutting down plugin 'CSV'
2019-09-26T23:38:45.136207Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
Is there anyone using this image ever getting this kind of error?
Update
It seems like mysql doesn't have the access to a particular file(s) or directory(ies), but I'm not sure which file(s) or directory(ies) . Here is the permission of mysql data directory:
clp#magento2dev:/$ ls -la /var/lib | grep mysql
drwxr-x--- 1 mysql mysql 4096 Sep 26 23:38 mysql
drwxrwx--- 2 mysql mysql 4096 Jul 11 15:24 mysql-files
drwxr-x--- 2 mysql mysql 4096 Jul 11 15:24 mysql-keyring

ERROR 1049 (42000): Unknown database 'test'

I am trying to install mySQL server on CentOS6.6 without root access.
Here are my steps.
Unpack mysql-8.0.11-linux-glibc2.12-i686 in a directory(EX:[Base MySQL Directory])
Initialize and generate root password:
./mysqld --initialize --user=mysql --lc_messages_dir=[Base MySQL Directory]/share --basedir=[Base MySQL Directory] --datadir=[BaseMySQL Directory]/data --log-error=[Base MySQL Directory]/data/mysql.err --pid-file=[Base MySQL Directory]/mysql.pid --socket=[Base MySQL Directory]/thesock --port=3306 &
Start the server:
./mysqld --user=mysql --basedir=[Base MySQL Directory] --lc_messages_dir=[Base MySQL Directory]/share --datadir=[Base MySQL Directory]/data --log-error=[Base MySQL Directory]/data/mysql.err --pid-file=[Base MySQL Directory]/mysql.pid --socket=[Base MySQL Directory]/thesock --port=3306 &
Access MySQL database:
./mysql --socket=$MYSQL_TED_HOME/thesock --user=root --password="IL-Rp=Wj*3dg"
But I got an Error message:
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1049 (42000): Unknown database 'test'
I know there are already tons of questions like "ERROR 1049 (42000): Unknown database....
". But I couldn't find any of them is similar to mine.
Here is "mysql.err":
[Warning] Changed limits: max_open_files: 1024 (requested 5000)
[Warning] Changed limits: table_open_cache: 431 (requested 2000)
[Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
[Warning] One can only use the --user switch if running as root
[Warning] InnoDB: New log files created, LSN=45790
[Warning] InnoDB: Creating foreign key constraint system tables.
[Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: ec2d7935-43d0-11e8-96ee-d89d6726c984.
[Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
[Note] A temporary password is generated for root#localhost: IL-Rp=Wj*3dg
[Warning] Changed limits: max_open_files: 1024 (requested 5000)
[Warning] Changed limits: table_open_cache: 431 (requested 2000)
[Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
[Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
[Note] ./mysqld (mysqld 5.7.13) starting as process 6390 ...
[Warning] One can only use the --user switch if running as root
[Note] InnoDB: PUNCH HOLE support not available
[Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
[Note] InnoDB: Uses event mutexes
[Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier
[Note] InnoDB: Compressed tables use zlib 1.2.3
[Note] InnoDB: Using Linux native AIO
[Note] InnoDB: Number of pools: 1
[Note] InnoDB: Using CPU crc32 instructions
[Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
[Note] InnoDB: Completed initialization of buffer pool
[Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
[Note] InnoDB: Highest supported file format is Barracuda.
[Note] InnoDB: Creating shared tablespace for temporary tables
[Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
[Note] InnoDB: File './ibtmp1' size is now 12 MB.
[Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
[Note] InnoDB: 32 non-redo rollback segment(s) are active.
[Note] InnoDB: Waiting for purge to start
[Note] InnoDB: 5.7.13 started; log sequence number 2524437
[Note] InnoDB: Loading buffer pool(s) from [Base MySQL Directory]/mysql-5.7.13-linux-glibc2.5-x86_64/data/ib_buffer_pool
[Note] Plugin 'FEDERATED' is disabled.
[Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
[Note] Server hostname (bind-address): '*'; port: 3306
[Note] IPv6 is available.
[Note] - '::' resolves to '::';
[Note] Server socket created on IP: '::'.
[Note] InnoDB: Buffer pool(s) load completed at 180419 20:55:57
[Note] Event Scheduler: Loaded 0 events
[Note] ./mysqld: ready for connections.
Version: '5.7.13' socket: '[Base MySQL Directory]/thesock' port: 3306 MySQL Community Server (GPL)

mysql 5.7.18 failed to start on Windows 10

I did look up the web for a solution such as this very relevant post on SO, to no avail.
Here is the steps that I installed mysql for win 10 and attempts to start it:
downloaded mysql 5.7.18 zip file and unzip it into my app folder;
open "cmd" as admin and run "mysqld --install", it shows "Service successfully installed."
run "net start mysql", it shows:
The MySQL service is starting.
The MySQL service could not be started.
The service did not report an error.
More help is available by typing NET HELPMSG 3534.
Run "mysqld.exe --console", it chunked out lines of messages like below:
2017-07-16T14:55:49.066437Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-07-16T14:55:49.077216Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2017-07-16T14:55:49.081191Z 0 [Note] mysqld.exe (mysqld 5.7.18) starting as process 15872 ...
2017-07-16T14:55:50.167310Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2017-07-16T14:55:50.167310Z 0 [Note] InnoDB: Uses event mutexes
2017-07-16T14:55:50.168434Z 0 [Note] InnoDB: _mm_lfence() and _mm_sfence() are used for memory barrier
2017-07-16T14:55:50.169398Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-07-16T14:55:50.195084Z 0 [Note] InnoDB: Number of pools: 1
2017-07-16T14:55:50.249204Z 0 [Note] InnoDB: Not using CPU crc32 instructions
2017-07-16T14:55:50.290217Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2017-07-16T14:55:50.296068Z 0 [Note] InnoDB: Completed initialization of buffer pool
2017-07-16T14:55:50.453825Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2017-07-16T14:55:50.813667Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2017-07-16T14:55:50.815630Z 0 [Note] InnoDB: Setting file '.\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2017-07-16T14:55:51.040444Z 0 [Note] InnoDB: File '.\ibtmp1' size is now 12 MB.
2017-07-16T14:55:51.062121Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2017-07-16T14:55:51.062590Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2017-07-16T14:55:51.068603Z 0 [Note] InnoDB: Waiting for purge to start
2017-07-16T14:55:51.128491Z 0 [Note] InnoDB: 5.7.18 started; log sequence number 1210018
2017-07-16T14:55:51.132269Z 0 [Note] InnoDB: Loading buffer pool(s) from C:\Users\jonat\opt\mysql-5.7.18-winx64\data\ib_buffer_pool
2017-07-16T14:55:51.133249Z 0 [Note] Plugin 'FEDERATED' is disabled.
mysqld: Table 'mysql.plugin' doesn't exist
2017-07-16T14:55:51.165071Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2017-07-16T14:55:51.233060Z 0 [Note] InnoDB: Buffer pool(s) load completed at 170716 10:55:51
2017-07-16T14:55:51.251567Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2017-07-16T14:55:51.267669Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2017-07-16T14:55:51.272001Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2017-07-16T14:55:51.274922Z 0 [Note] IPv6 is available.
2017-07-16T14:55:51.278873Z 0 [Note] - '::' resolves to '::';
2017-07-16T14:55:51.281791Z 0 [Note] Server socket created on IP: '::'.
2017-07-16T14:55:51.308759Z 0 [Warning] Failed to open optimizer cost constant tables
2017-07-16T14:55:51.310583Z 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
2017-07-16T14:55:51.311554Z 0 [ERROR] Aborting
2017-07-16T14:55:51.312531Z 0 [Note] Binlog end
2017-07-16T14:55:51.314481Z 0 [Note] Shutting down plugin 'ngram'
2017-07-16T14:55:51.314481Z 0 [Note] Shutting down plugin 'partition'
2017-07-16T14:55:51.314481Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2017-07-16T14:55:51.315463Z 0 [Note] Shutting down plugin 'ARCHIVE'
2017-07-16T14:55:51.315463Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2017-07-16T14:55:51.316444Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2017-07-16T14:55:51.319389Z 0 [Note] Shutting down plugin 'MyISAM'
....
2017-07-16T14:55:52.615409Z 0 [Note] Shutting down plugin 'binlog'
2017-07-16T14:55:52.618322Z 0 [Note] mysqld.exe: Shutdown complete
In MySQL installation root folder (suppose it is c:\mysql), create a text file, say mypass.txt and copy this line to it:
ALTER USER 'root'#'localhost' IDENTIFIED BY '<yourpassword>';
The run
mysqld --initialize
mysqld --init-file=c:/mysql/mypass.txt
And if you want to run MySQL as a Windows Service:
mysqld --install MySQLXY --defaults-file="c:/mysql/my.ini"