Using Docker Toolbox in macOS 10.11. Trying to start Percona 5.7 container via docker-compose:
percona:
image: percona:5.7
user: "1000:50"
restart: "no"
volumes:
- ./db:/var/lib/mysql:rw
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: qwerty
But when run:
docker-compose up
it shows me this log:
percona_1 | Initializing database
percona_1 | 2018-02-27T18:21:40.471171Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
percona_1 | 2018-02-27T18:21:40.471336Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
percona_1 | 2018-02-27T18:21:40.509126Z 0 [Warning] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
percona_1 | 2018-02-27T18:21:40.511757Z 0 [Warning] One can only use the --user switch if running as root
percona_1 |
percona_1 | 2018-02-27T18:21:42.900823Z 0 [ERROR] InnoDB: Operating system error number 22 in a file operation.
percona_1 | 2018-02-27T18:21:42.901071Z 0 [ERROR] InnoDB: Error number 22 means 'Invalid argument'
percona_1 | 2018-02-27T18:21:42.901164Z 0 [ERROR] InnoDB: File ./ib_logfile101: 'aio write' returned OS error 122. Cannot continue operation
percona_1 | 2018-02-27T18:21:42.901187Z 0 [ERROR] InnoDB: Cannot continue operation.
docker_percona_1 exited with code 3
Can you help me understand the problem?
It means the filesystem your using doesn't support aio. You can tell this to innodb by adding the following line to my.cnf:
innodb_use_native_aio=0
also remove innodb_flush_method = O_DIRECT if enabled in my.cnf
Related
I keep getting an error when attempting to run a mariadb server on my raspberry pi and not really sure how to proceed.
I started a terminal window and these are the steps I have to follow for my class, however I can't even get past sudo mysqld -console :(
Installation of mariadb and simple exercise of CRUD:
sudo apt-get update
sudo apt-get install mariadb-server
sudo mysqld –console (to start the DB in the background)
(on a different terminal) sudo mysql (to log in as root)
create user ‘john’#’localhost’ identified by ‘password’;
select host, user from mysql.user;
Error Message:
e2022-05-25 12:49:20 0 [Note] mysqld (mysqld 10.5.15-MariaDB-0+deb11u1) starting
as process 19643 ...
2022-05-25 12:49:20 0 [Note] InnoDB: Uses event mutexes
2022-05-25 12:49:20 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-05-25 12:49:20 0 [Note] InnoDB: Number of pools: 1
2022-05-25 12:49:20 0 [Note] InnoDB: Using generic crc32 instructions
2022-05-25 12:49:20 0 [Note] InnoDB: Using Linux native AIO
2022-05-25 12:49:20 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2022-05-25 12:49:20 0 [Note] InnoDB: Completed initialization of buffer pool
2022-05-25 12:49:21 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=45178,45178
2022-05-25 12:49:21 0 [ERROR] InnoDB: Malformed log record; set innodb_force_recovery=1 to ignore.
2022-05-25 12:49:21 0 [Note] InnoDB: Dump from the start of the mini-transaction (LSN=45178) to 100 bytes after the record:
len 106; hex 73733130312e69626400120500b20108b20f05b50400000004b50400000015c30804ffc30204ffc30604ffc30204ffc30604ffc30204ffc30e04ffc30204ffc30604ffc30204ff34050075013405003540120501b20105460500802e10ff350500802d01b200fe350500; asc ss101.ibd 4 u 4 5# F . 5 - 5 ;
2022-05-25 12:49:21 0 [Warning] InnoDB: Log scan aborted at LSN 51712
2022-05-25 12:49:21 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2022-05-25 12:49:21 0 [Note] InnoDB: Starting shutdown...
2022-05-25 12:49:21 0 [ERROR] Plugin 'InnoDB' init function returned error.
2022-05-25 12:49:21 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2022-05-25 12:49:21 0 [Note] Plugin 'FEEDBACK' is disabled.
mysqld: Too many arguments (first extra is '–console').
2022-05-25 12:49:21 0 [ERROR] Aborting
I am new to docker and try to run a mysql image using below command on a windows server.
docker run -e MYSQL_ROOT_PASSWORD=sEe#21 -e MYSQL_DATABASE=emp_db -p 3306:3306 --name mysql_emp mysql
It successfully downloaded and configured. I am getting a log in the CMD which says
root#localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
I have already given the root password which I set to use by the application and hence I get an error saying that cannot connect to DB from the spring boot service. MySQL full log is as follows
2021-02-10 14:25:43+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.23-1debian10 started.
2021-02-10 14:25:43+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2021-02-10 14:25:43+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.23-1debian10 started.
2021-02-10 14:25:43+00:00 [Note] [Entrypoint]: Initializing database files
2021-02-10T14:25:43.801929Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.23) initializing of server in progress as process 43
2021-02-10T14:25:43.808218Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-02-10T14:25:44.547274Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-02-10T14:25:46.632843Z 6 [Warning] [MY-010453] [Server] root#localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2021-02-10 14:25:51+00:00 [Note] [Entrypoint]: Database files initialized
2021-02-10 14:25:51+00:00 [Note] [Entrypoint]: Starting temporary server
2021-02-10T14:25:51.770335Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.23) starting as process 88
2021-02-10T14:25:51.804446Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-02-10T14:25:52.039318Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-02-10T14:25:52.169969Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: /var/run/mysqld/mysqlx.sock
2021-02-10T14:25:52.299951Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-02-10T14:25:52.300259Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-02-10T14:25:52.304466Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2021-02-10T14:25:52.327240Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.23' socket: '/var/run/mysqld/mysqld.sock' port: 0 MySQL Community Server - GPL.
2021-02-10 14:25:52+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-02-10 14:25:58+00:00 [Note] [Entrypoint]: Creating database emp_db
2021-02-10 14:25:58+00:00 [Note] [Entrypoint]: Stopping temporary server
2021-02-10T14:25:58.448858Z 11 [System] [MY-013172] [Server] Received SHUTDOWN from user root. Shutting down mysqld (Version: 8.0.23).
2021-02-10T14:26:00.212816Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.23) MySQL Community Server - GPL.
2021-02-10 14:26:00+00:00 [Note] [Entrypoint]: Temporary server stopped
2021-02-10 14:26:00+00:00 [Note] [Entrypoint]: MySQL init process done. Ready for start up.
2021-02-10T14:26:00.738118Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.23) starting as process 1
2021-02-10T14:26:00.763121Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-02-10T14:26:00.999006Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-02-10T14:26:01.135971Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
2021-02-10T14:26:01.269210Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-02-10T14:26:01.269444Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-02-10T14:26:01.275037Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2021-02-10T14:26:01.297388Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.23' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server - GPL.
Would like to understand what is wrong I am doing ? any parameter is missing in the docker run command ?
It is just an example of misleading printing:
That is just a warning printed by during database file initialization (mysqld --initialize-insecure). The root user with password is created later while the database is listening only on the unix socket.
From https://github.com/docker-library/mysql/issues/307#issuecomment-313784886
What happens if you structure your run command as it is on the MySQL Docker hub page:
docker run --name mysql_emp -e MYSQL_ROOT_PASSWORD=sEe#21 -e MYSQL_DATABASE=emp_db -p 3306:3306 -d mysql:latest
If that doesn't work you could try running from a dockerfile, similar to this question: MYSQL docker file
I just upgraded to MacOS Big Sur, and I found out I can't login to mysql console with mysql -u root (without password).
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
I installed MariaDB with brew (brew install mariadb)
I checked the mysql daemon, and found following error
Xuans-MacBook-Pro:~ xuan$ mysqld
2020-12-21 15:46:27 0 [Note] mysqld (mysqld 10.5.8-MariaDB) starting as process 2091 ...
2020-12-21 15:46:27 0 [Warning] Can't create test file /usr/local/var/mysql/Xuans-MacBook-Pro-2.lower-test
2020-12-21 15:46:27 0 [ERROR] mysqld: File '/usr/local/var/mysql/aria_log_control' not found (Errcode: 13 "Permission denied")
2020-12-21 15:46:27 0 [ERROR] mysqld: Got error 'Can't open file' when trying to use aria control file '/usr/local/var/mysql/aria_log_control'
2020-12-21 15:46:27 0 [ERROR] Plugin 'Aria' init function returned error.
2020-12-21 15:46:27 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2020-12-21 15:46:27 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
2020-12-21 15:46:27 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
2020-12-21 15:46:27 0 [ERROR] Plugin 'InnoDB' init function returned error.
2020-12-21 15:46:27 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2020-12-21 15:46:27 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-12-21 15:46:27 0 [ERROR] Could not open mysql.plugin table: "Table 'mysql.plugin' doesn't exist". Some plugins may be not loaded
2020-12-21 15:46:27 0 [ERROR] Failed to initialize plugins.
2020-12-21 15:46:27 0 [ERROR] Aborting
Here is the permission of /usr/local/var/mysql/
drwxr-xr-x 68 xuan admin 2176 21 Dec 15:48 mysql
socket file location
Xuans-MacBook-Pro:xuan$ mysqld --help --verbose | grep sock
socket /tmp/mysql.sock
unix-socket ON
Any suggestions?
I had this same issue on a 2018 macbook pro with an i9 running big sur 11.1
I could link to a mysql database with mysql workbench and datagrip no problem but when I tried to access mysql from the terminal i got "can't connect to local MYSQL server through socket."
I dropped back to the /usr/local/mysql/bin and ran ./mysql -u root -p and it connects.
Is this a big sur security issue? MAMP is running. The MYSQL editors act normal. It seems big sur will not allow the socket connect through MAMP.
Login as user root via socket requires that the owner of the socket is root, not any other user, since authentication will performed via unix socket authentication.
so a simple sudo mysql -uroot should work.
I am facing an issue on docker container. When I execute the docker-compose up to start the application the Postgres container is not starting.
Error which I get after docker-compose up
/usr/local/bundle/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `initialize': could not translate host name "db" to address: Name or service not known (PG::ConnectionBad)
Now it is frequently happing. I tried with few steps as add ports for db container i.e 5432:5432. I used to start-stop the specific db container so that the connection should get re-established but it is not working.
Application details:
Rails Version: 4.2.0 Ruby version: 2.2.0
docker-compose.yml
version: '3.7'
services:
selenium:
image: selenium/standalone-chrome-debug:3.141.59-krypton
ports: ['4444:4444', '5900:5900']
logging:
driver: none
redis:
image: redis:3.0.0
elastic:
image: elasticsearch:1.5.2
db:
image: postgres:9.3.10
volumes:
- ./tmp/db:/var/lib/postgresql/data
- .:/home
XYZ:
build: .
command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
stdin_open: true
tty: true
volumes:
- XYZ-sync:/home:nocopy
ports:
- "3000:3000"
depends_on:
- db
- redis
- elastic
- selenium
environment:
- REDIS_URL=redis://redis:6379/0
- ELASTICSEARCH_URL=elastic://elastic:9200/0
- SELENIUM_HOST=selenium
- SELENIUM_PORT=4444
- TEST_APP_HOST=XYZ
- TEST_PORT=3000
db log
db_1 | LOG: database system was shut down at 2019-09-10 07:37:08 UTC
db_1 | LOG: MultiXact member wraparound protections are now enabled
db_1 | LOG: database system is ready to accept connections
db_1 | LOG: autovacuum launcher started
db_1 | LOG: received smart shutdown request
db_1 | LOG: autovacuum launcher shutting down
db_1 | LOG: shutting down
db_1 | LOG: database system is shut down
db_1 | LOG: database system was shut down at 2019-09-10 07:37:50 UTC
db_1 | LOG: MultiXact member wraparound protections are now enabled
db_1 | LOG: database system is ready to accept connections
db_1 | LOG: autovacuum launcher started
db_1 | LOG: database system was interrupted; last known up at 2019-09-10 07:38:31 UTC
db_1 | LOG: received smart shutdown request
db_1 | LOG: database system was interrupted; last known up at 2019-09-10 07:38:31 UTC
db_1 | LOG: database system was not properly shut down; automatic recovery in progress
db_1 | LOG: record with zero length at 0/1D8F0120
db_1 | LOG: redo is not required
db_1 | LOG: MultiXact member wraparound protections are now enabled
db_1 | LOG: autovacuum launcher started
db_1 | LOG: database system is ready to accept connections
db_1 | LOG: stats_timestamp 2019-09-10 08:02:39.288642+00 is later than collector's time 2019-09-10 08:02:39.189551+00 for database 0
db_1 | LOG: database system was interrupted; last known up at 2019-09-10 08:18:02 UTC
db_1 | FATAL: the database system is starting up
docker-compose ps output
xyz_db_1 /docker-entrypoint.sh postgres Up 5432/tcp
xyz_elastic_1 /docker-entrypoint.sh elas ... Up 9200/tcp, 9300/tcp
xyz_xyz_1 bash -c rm -f tmp/pids/ser ... Exit 1
xyz_redis_1 /entrypoint.sh redis-server Up 6379/tcp
xyz_selenium_1 /opt/bin/entry_point.sh Up 0.0.0.0:4444->4444/tcp, 0.0.0.0:5900->5900/tcp
database.yml
default: &default
adapter: postgresql
encoding: unicode
pool: 5
username: postgres
password:
host: db
development:
<<: *default
database: XYZ_development
test:
<<: *default
database: XYZ_test
development_migrate:
adapter: mysql2
encoding: utf8
database: xyz_ee
username: root
password:
host: localhost
pool: 5
Any help will be appreciated.
I resolved my issue with the help of #jayDosrsey suggestion.
The DB container get started before the main web container and hence it always gets failed to start the container and I again need to restart the web container.
Resolved this issue by adding the health check condition while starting the rails server.
XYZ:
build: .
command: bash -c "while !</dev/tcp/db/5432; do sleep 1; done; rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
...
Now I am able to start the container in sequence.
Mysql Server stop working after 5 seconds (fresh install of uwamp)
Uwamp version 3.1 started with Administrator rights on windows 10 32bits.
Here is the Mysql log :
2016-02-25T13:53:19.049733Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-02-25T13:53:19.049733Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2016-02-25T13:53:19.049733Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
2016-02-25T13:53:19.049733Z 0 [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.
2016-02-25T13:53:19.050735Z 0 [Note] C:\UwAmp\bin\database\mysql-5.7.11\bin\mysqld.exe (mysqld 5.7.11) starting as process 6552 ...
2016-02-25T13:53:19.117843Z 0 [ERROR] Can't open shared library 'C:\UwAmp\bin\database\mysql-5.7.11\lib\plugin\keyring_file.dll' (errno: 126 Le module spécifié est introuvable.)
2016-02-25T13:53:19.122851Z 0 [ERROR] Couldn't load plugin named 'keyring_file' with soname 'keyring_file.dll'.
2016-02-25T13:53:19.127856Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2016-02-25T13:53:19.130861Z 0 [Note] InnoDB: Uses event mutexes
2016-02-25T13:53:19.132864Z 0 [Note] InnoDB: Memory barrier is not used
2016-02-25T13:53:19.134867Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-02-25T13:53:19.137871Z 0 [Note] InnoDB: Number of pools: 1
2016-02-25T13:53:19.139875Z 0 [Note] InnoDB: Not using CPU crc32 instructions
2016-02-25T13:53:21.056091Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2016-02-25T13:53:21.087354Z 0 [Note] InnoDB: Completed initialization of buffer pool
2016-02-25T13:53:21.234144Z 0 [Note] InnoDB: Setting log file .\ib_logfile101 size to 48 MB
2016-02-25T13:53:22.659215Z 0 [Note] InnoDB: Setting log file .\ib_logfile1 size to 48 MB
2016-02-25T13:53:24.176685Z 0 [Note] InnoDB: Renaming log file .\ib_logfile101 to .\ib_logfile0
2016-02-25T13:53:24.176685Z 0 [Warning] InnoDB: New log files created, LSN=2602779
2016-02-25T13:53:24.176685Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2016-02-25T13:53:24.192315Z 0 [ERROR] InnoDB: Operating system error number 87 in a file operation.
2016-02-25T13:53:24.192315Z 0 [Note] InnoDB: Some operating system error numbers are described at http://dev.mysql.com/doc/refman/5.7/en/operating-system-error-codes.html
2016-02-25T13:53:24.192315Z 0 [ERROR] InnoDB: File .\ib_logfile0: 'aio read' returned OS error 187. Cannot continue operation
2016-02-25T13:53:24.192315Z 0 [ERROR] InnoDB: Cannot continue operation.
In the uwAmp control panel, click on XDebug client and select "Remove MySql log".Then try to start MySQL in the top of control panel. It must works fine.
I had the same issue. Try the following://in my case it worked
Step 1: Download and install the wamp server app from the http://www.wampserver.com/
Step 2: Open the wamp server installation folder of the wamp server app. In my case is C:\wamp64
Step 3: Once inside the wamp folder, open the folders in the following sequence bin\mysql\mysql5.7.14
Step 4: You should find in here a folder called lib
Step 5: Copy the folder lib to your UwAmp folder but not just to folder but to the UwAmp\bin\database\mysql-5.7.11- here.
Step 6: Restart the UwAmp or stop the server and restart it again.
Step 7: At this stage the MySQl should work.