laradock_mysql won't start and exits(1) - mysql

When i'm composing up from my laradock folder. All services start except from mysql. Screenshot here
I have restored my docker to default settings but mysql keeps exiting. My error say's i'm setting a value. But i don't even have a database. So that confuses me.
ERROR: mysqld failed while attempting to check config
mysql_1 | command was: "mysqld --verbose --help"
mysql_1 |
mysql_1 | 2018-05-07T16:24:32.727143Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
mysql_1 | 2018-05-07T16:24:32.727230Z 0 [ERROR] [MY-011071] [Server] /usr/sbin/mysqld: Error while setting value 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' to 'sql_mode'
mysql_1 | 2018-05-07T16:24:32.729063Z 0 [ERROR] [MY-010119] [Server] Aborting

edited laradock/.env,set MYSQL_VERSION from latest to 5.7
deleted ~/.laradock/mysql/ directory completely (Warning, This may delete your data ! )
then rebuild docker-compose build mysql
docker-compose up -d mysql as usual
Hope this helps :)

Related

MYSQL 8 in WSL Ubuntu 20.04 change directory

I managed to change the Mysql directory normally as shown in some tutorials, however it does not start, I changed the mysql 8 data's directory that is in /var/lib/mysql to /mnt/d/mysql, either with a copy of the databases that were running or the location zeroed, it does not start. The error log gives the following message:
[System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.31-0ubuntu0.20.04.2) (Ubuntu). mysqld_safe mysqld from pid file /mnt/d/mysql/VERIFIQIMOVEIS.pid ended mysqld_safe Logging to '/var/log/mysql/error.log'. mysqld_safe Starting mysqld daemon with databases from /mnt/d/mysql [Warning] [MY-010139] [Server] Changed limits: max_open_files: 1024 (requested 8161) [Warning] [MY-010142] [Server] Changed limits: table_open_cache: 431 (requested 4000) [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.31-0ubuntu0.20.04.2) starting as process 21204 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /mnt/d/mysql/ is case insensitive [Warning] [MY-010075] [Server] 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: 7e204e29-9132-11ed-aeb5-32ceaa8792ed. [ERROR] [MY-011011] [Server] Failed to find valid data directory. [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. [ERROR] [MY-010119] [Server] Aborting
I tried to set permissions with
sudo chown -R mysql:mysql /mnt/d/mysql sudo chmod -R 755 /mnt/d/mysql
I went to /etc/apparmor.d/tunables/alias and put the new path on the line
alias /var/lib/mysql/ -> /mnt/d/mysql/,
Well, after many attempts trying to make MySQL 8 work, changing its directory (appdir) to another HD (D:) using the path mnt/d/, I uninstalled mysql and installed MariaDB, which in my case came to work, I had just create a user 'debian-sys-maint'#'localhost' and set the same password that appears in /etc/mysql/debian.cnf this experience of mine is recorded, I hope one day it will help someone.

After including option --skip-grant-tables in configuration file, mysqld starts, runs, and then stops immediately

My situation is the following. I can't remember my root user passsword for accessing mysqld. I'm attempting to start mysqld with the option --skip-grant-tables option in the my.ini configuration file. However, I observe that when I enable the option and then try to restart mysqld (from Task Manager, for example), the service starts, runs, and then immediately stops. I've included a Screencastify video to show you the steps I take (1min50secs long). I'm also including the error file contents below for your review. I see a mention of an error but I don't understand its message.
2022-08-25T17:52:06.012094Z 0 [Warning] [MY-010915] [Server] '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.
2022-08-25T17:52:06.015237Z 0 [System] [MY-010116] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.28) starting as process 1048
2022-08-25T17:52:06.045494Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-08-25T17:52:06.398313Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-08-25T17:52:06.642873Z 0 [Warning] [MY-011311] [Server] Plugin mysqlx reported: 'All I/O interfaces are disabled, X Protocol won't be accessible'
2022-08-25T17:52:06.725383Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2022-08-25T17:52:06.726481Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2022-08-25T17:52:06.757168Z 0 [System] [MY-010931] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: ready for connections. Version: '8.0.28' socket: '' port: 0 MySQL Community Server - GPL.
2022-08-25T17:52:06.759476Z 0 [ERROR] [MY-010131] [Server] TCP/IP, --shared-memory, or --named-pipe should be configured on NT OS
2022-08-25T17:52:06.760755Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-08-25T17:52:07.903037Z 0 [ERROR] [MY-013183] [InnoDB] Assertion failure: trx0sys.cc:644:UT_LIST_GET_LEN(trx_sys->mysql_trx_list) == 0 thread 26320
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
17:52:07 UTC - mysqld got exception 0x16 ;
Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
7ff78a48fd48 mysqld.exe!?my_print_stacktrace##YAXPEBEK#Z()
7ff7896c004b mysqld.exe!?print_fatal_signal##YAXH#Z()
7ff7896bfe13 mysqld.exe!?my_server_abort##YAXXZ()
7ff78a47643a mysqld.exe!?my_abort##YAXXZ()
7ff78a6ac579 mysqld.exe!??$endl#DU?$char_traits#D#std###std##YAAEAV?$basic_ostream#DU?$char_traits#D#std###0#AEAV10##Z()
7ff78a5e8167 mysqld.exe!?set_compression_level#Zstd_comp#compression#transaction#binary_log##UEAAXI#Z()
7ff78a67033b mysqld.exe!??$endl#DU?$char_traits#D#std###std##YAAEAV?$basic_ostream#DU?$char_traits#D#std###0#AEAV10##Z()
7ff78a568550 mysqld.exe!?set_compression_level#Zstd_comp#compression#transaction#binary_log##UEAAXI#Z()
7ff7894a452b mysqld.exe!?ha_finalize_handlerton##YAHPEAUst_plugin_int###Z()
7ff7894e2304 mysqld.exe!?memcached_shutdown##YAXXZ()
7ff7894e78d9 mysqld.exe!?plugin_unlock_list##YAXPEAVTHD##PEAPEAUst_plugin_int##_K#Z()
7ff7894e6630 mysqld.exe!?plugin_shutdown##YAXXZ()
7ff789482d49 mysqld.exe!?check_valid_arguments_processor#Item_func##UEAA_NPEAE#Z()
7ff78949679a mysqld.exe!?underflow#?$basic_stringbuf#DU?$char_traits#D#std##V?$allocator#D#2##std##MEAAHXZ()
7ff78949531f mysqld.exe!?setup_conn_event_handler_threads##YAXXZ()
7ff7894988be mysqld.exe!?win_main##YAHHPEAPEAD#Z()
7ff7894916f5 mysqld.exe!?mysql_service##YAHPEAX#Z()
7ff789491d54 mysqld.exe!?mysqld_main##YAHHPEAPEAD#Z()
7ff78ab0b298 mysqld.exe!?set_timespec_nsec##YAXPEAUtimespec##_K#Z()
7ffe8b437034 KERNEL32.DLL!BaseThreadInitThunk()
7ffe8b742651 ntdll.dll!RtlUserThreadStart()
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
Any help will be appreciated. Thank you.
Enabling shared memory in server section of config file resolved the issue.
See this Stackoverflow post for context.
If you have an issue starting MySQL, try editing the my.ini configuration file, and set innodb_force_recovery to perhaps 3.
Here's how i've reset MySQL root password on Centos; note it's from the command line.
systemctl stop mysqld
systemctl set-environment MYSQLD_OPTS=--skip-grant-tables
systemctl start mysqld
mysql> UPDATE mysql.user SET authentication_string = PASSWORD ('ENTER_NEW_PASSWORD') WHERE User = 'root' AND Host = 'localhost';
mysql> FLUSH PRIVILEGES;
mysql> quit
systemctl stop mysqld
systemctl unset-environment MYSQLD_OPTS
systemctl start mysqld
# test #
mysql -u root#localhost -p

Laradock MySQL container exits(0) - Different lower_case_table_names settings for server ('2') and data dictionary ('0')

After installing Docker and Laradock on my Mac I'm trying to start the docker containers using the command:
docker-compose up -d nginx mysql phpmyadmin
I get the output:
Starting laradock_mysql_1 ... done
Starting laradock_docker-in-docker_1 ... done
Starting laradock_phpmyadmin_1 ... done
Starting laradock_workspace_1 ... done
Starting laradock_php-fpm_1 ... done
Starting laradock_nginx_1 ... done
Seems fine, but for some reason MySQL is crashing. When I try to start the container again I get the following message:
mysql_1 | 2020-10-01T10:19:52.124915Z 1 [Warning] [MY-012579] [InnoDB] fallocate(25, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 16384) returned errno: 22
mysql_1 | 2020-10-01T10:19:52.143672Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
mysql_1 | 2020-10-01T10:19:52.159801Z 1 [ERROR] [MY-011087] [Server] Different lower_case_table_names settings for server ('2') and data dictionary ('0').
mysql_1 | 2020-10-01T10:19:52.160778Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
mysql_1 | 2020-10-01T10:19:52.161607Z 0 [ERROR] [MY-010119] [Server] Aborting
mysql_1 | 2020-10-01T10:19:52.795909Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.21) MySQL Community Server - GPL.
I tried adding "command: --lower_case_table_names=0" to my docker-compose file, but that does not seem to help.
MySQL crashes with:
mysql_1 | 2020-10-01 10:21:28+00:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config
mysql_1 | command was: mysqld --lower_case_table_names=0 --verbose --help
mysql_1 | 2020-10-01T10:21:28.547104Z 0 [ERROR] [MY-010158] [Server] The server option 'lower_case_table_names' is configured to use case sensitive table names but the data directory is on a case-insensitive file system which is an unsupported combination. Please consider either using a case sensitive file system for your data directory or switching to a case-insensitive table name mode.
mysql_1 | 2020-10-01T10:21:28.549273Z 0 [ERROR] [MY-010119] [Server] Aborting
My solution:
cmd
fsutil file setCaseSensitiveInfo "C:\Users\XXXXX\.laradock\data\mysql"
This will change lower_case_table_names for data dictionary from ('0') to ('2') in Windows 10.
XXXXX - your username in Windows 10.
then:
docker-compose up mysql
This was most likely caused by the docker update to 2.4. See:
Mysql not starting in a docker container on MacOS after docker update
The solution madx provided works. And if got an error message says that the target folder is not empty and therefore cannot make the folder case-sensitive, just 1.move the files and subfolders out of the target folder; 2.make the target folder case-sensitive; 3.move the files and subfolders back to the target folder. Everything would be OK.

mysql 8 --skip-symbolic-links

I am creating a service in docker-compose.
Look for the problem. In the net. most of them ask me to change mysql version.
The code I have in my dockerfile is:
FROM mysql:8
COPY docker-initdb.sql /docker-entrypoint-initdb.d/initdb.sql
RUN ["mysqld", "--skip-mysqlx", "--default-authentication-plugin=mysql_native_password"]
I have this exception. when executing
Step 3/3 : RUN ["mysqld", "--skip-mysqlx", "--default-authentication-plugin=mysql_native_password"]
---> Running in 33916b9536b9
2019-08-22T17:35:34.255249Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2019-08-22T17:35:34.255316Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.17) starting as process 1
2019-08-22T17:35:34.258135Z 0 [ERROR] [MY-010123] [Server] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
2019-08-22T17:35:34.258191Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-08-22T17:35:34.259440Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.17) MySQL Community Server - GPL.
Thank you.
You should not use RUN but ENTRYPOINT to start the server. RUN is executing at build time. ENTRYPOINT is executed when the container starts.
FROM mysql:8
USER mysql
ENTRYPOINT mysqld --initialize --user=mysql && mysqld --skip-mysqlx --default-authentication-plugin=mysql_native_password
Also, you need to initialize the database and, as the error says, run the server as a different user than root.
Check the container logs for the root user password.
Docker Mysql v8 also gave me this error
2019-08-22T17:35:34.255249Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2019-08-22T17:35:34.255316Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.17) starting as process 1
2019-08-22T17:35:34.258135Z 0 [ERROR] [MY-010123] [Server] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
2019-08-22T17:35:34.258191Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-08-22T17:35:34.259440Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.17) MySQL Community Server - GPL.
I think MySQL V8 needs some kind of extra config.
So I changed my Mysql image to 5.7.22 version and now it works. It's not the best solution but it's the fastest.

mysql local installation mysql_install_db error

I am working on a *nix machine and I don't have root privileges.
I am trying to install mysql locally using this blogpost: http://www.thedance.net/~roth/TECHBLOG/localMySQL.html
However, I am stuck at scripts/mysql_install_db command.
When I run this command I get the following error:
FATAL ERROR: Neither host 'server.address.com' nor 'localhost' could be looked up with
/usr/bin/resolveip
Please configure the 'hostname' command to return a correct hostname.
If you want to solve this at a later stage, restart this script
with the --force option
On further digging, I found that adding --basedirresolves this issue. But then it generates the following errors:
$scripts/mysql_install_db --basedir=.
Installing MySQL system tables...2015-07-17 01:38:15 0 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
2015-07-17 01:38:15 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-07-17 01:38:15 0 [Note] ./bin/mysqld (mysqld 5.6.25) starting as process 10281 ...
2015-07-17 01:38:15 10281 [ERROR] Can't find messagefile '/usr/share/mysql/errmsg.sys'
2015-07-17 01:38:15 10281 [Warning] Can't create test file /var/lib/mysql/head.lower-test
2015-07-17 01:38:15 10281 [Warning] Can't create test file /var/lib/mysql/head.lower-test
./bin/mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 13 - Permission denied)
2015-07-17 01:38:15 10281 [ERROR] Aborting
2015-07-17 01:38:15 10281 [Note] Binlog end
2015-07-17 01:38:15 10281 [Note]
When I add --datadir=myDataDir (where myDataDir is a local directory) it generates following error:
$scripts/mysql_install_db --basedir=. --datadir=myDataDir
Installing MySQL system tables...2015-07-17 01:40:54 0 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
2015-07-17 01:40:54 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-07-17 01:40:54 0 [Note] ./bin/mysqld (mysqld 5.6.25) starting as process 10329 ...
2015-07-17 01:40:54 10329 [ERROR] Can't find messagefile '/usr/share/mysql/errmsg.sys'
It is trying to access system level folders and because of the permission issues it is failing. How do I install it locally. And how do I setup the hostname?
The problem lies on the following line in log:
[ERROR] Can't find messagefile '/usr/share/mysql/errmsg.sys'
To solve it, add this flag to your command:
--lc-messages-dir="/some/path/you/can/access/without/sudo/"