Keyring mirgration failure Fedora mySql - mysql

I've been working through MySQL but I've been having trouble entering my MySQL server to change certain properties. When I attempt to enter as root I get the following output:
//]$ sudo mysqld -u root -p
Enter password:
mysqld: Can not perform keyring migration : Invalid --keyring-migration-source option.
2020-02-12T05:34:59.837715Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.19) starting as process 64421
2020-02-12T05:34:59.839462Z 0 [ERROR] [MY-011084] [Server] Keyring migration failed.
2020-02-12T05:34:59.839481Z 0 [ERROR] [MY-010119] [Server] Aborting
2020-02-12T05:34:59.839559Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.19) MySQL Community Server - GPL.
Can't figure out how to sort this out. Any help would be much appreciated.

keyring-migration-source exists in one of the configuration files.
mysqld --help --verbose will list which files are read at the top. Look in those and remove the line.
Also don't run mysqld as root. Its a security hazard and won't start. Use the systemctl start mysql that fedora provides.

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.

Cannot connect to the MySQL database server, there are error messages but I do not know what the problem is and how to solve it

I get the below error messages and think that I have more than one problem:
The first one is common:
mysql-bin.index' not found (Errcode: 13)
and I want to solve it by
chgrp -R mysql /usr/local/mysql/data && chown -R mysql /usr/local/mysql/data
But I got another error message:
chown: /usr/local/mysql/data/.DS_Store: Operation not permitted
I do not know how to solve these...
2020-09-12T04:15:42.843047Z 0 [System] [MY-010116] [Server] /usr/local/mysql-8.0.21-macos10.15-x86_64/bin/mysqld (mysqld 8.0.21) starting as process 1012
2020-09-12T04:15:42.849049Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/mysql-8.0.21-macos10.15-x86_64/data/ is case insensitive
2020-09-12T04:15:42.855324Z 0 [ERROR] [MY-010119] [Server] Aborting
2020-09-12T04:15:42.855495Z 0 [System] [MY-010910] [Server] /usr/local/mysql-8.0.21-macos10.15-x86_64/bin/mysqld: Shutdown complete (mysqld 8.0.21) MySQL Community Server - GPL.
These are other error messages. Can anyone figure out the problem and the solution for me?
File '/etc/mysql/var/​log-bin.index' not found (Errcode: 13). Doesn't mean it's not there; Error 13 means "Permission denied" Which If there is no .index file, and no binlogs mysql will just start over from scratch Remove any files in that directory.
Option 1:
service mysqld stop
Copy the log files including the .index file to new location.
cp mysql-bin.log* /path/to/binlogs
cp mysql-bin.index /path/to/binlogs
Do Changes in the /etc/my.cnf file.
[mysqld]
log-bin=/path/to/newdirecory/mysql-bin
log-bin-index=/path/to/newdirectory/mysql-bin.index
service mysqld start
Option 2:
Use this utiltiy to relocate binary logs:
mysqlbinlogmove --binlog-dir=/server/data /new/binlog_dir

MySQL server dies or doesn't start on Mac OS Catalina 10.15.4

I installed the latest version of MySQL mysql-8.0.20-macos10.15-x86_64
When I start the server, it doesn't start. When I look into logs I see the following message:
sudo tail -n10 /usr/local/mysql/data/MacBook-Pro.local.err
2020-04-29T19:14:15.781011Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/tmp/mysqlx.sock' bind-address: '::' port: 33060
2020-04-29T19:14:15.875568Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2020-04-29T19:14:15.881149Z 0 [ERROR] [MY-000067] [Server] unknown variable 'query_cache_size=32M'.
2020-04-29T19:14:15.882207Z 0 [ERROR] [MY-010119] [Server] Aborting
2020-04-29T19:14:16.820509Z 0 [System] [MY-010910] [Server] /usr/local/mysql/bin/mysqld: Shutdown complete (mysqld 8.0.20) MySQL Community Server - GPL.
I cannot find where query_cache_size is coming from and I didn't set it.
This is the list of files/folder in MySQL folder:
LICENSE bin docs keyring man support-files
README data include lib share
I found the fix.
Documenting my troubleshooting/fix steps, so that it can save someone else hours of debugging.
Located the my.cnf file /private/etc/my.cnf, and noticed that a lot of configs were still conflicting as I was disabling them one by one. So, I simply renamed my.cnf to my.cnf.bak i.e. forcing MySQL to create a brand new file (now god knows where it created new one, that is a mystery for some other day :) )
Started the server using sudo /usr/local/mysql/support-files/mysql.server start
The server was still not starting and it was erroring with Unable to lock ./ibdata1 error: 35
So, I killed the ghost mysql process ps aux | grep mysql and kill <process-name>
Yay! server started running.

mysql server down after changing innodb_buffer_pool_size

I change my innodb_buffer_pool_size from 8M to 2G in my.ini. After that, I cannot connect to my SQL server.
My local server is down - when I try to log in using mysql -u root -p in window command., I get:
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061).
I tried the following but still cannot restart my server:
Start the MySQL80 via windows service (start and shutdown)
Remove the ib_logfile (ib_logfile0, ib_logfile1, ib_buffer_pool, ib_data1
from ProgramData\MySQL\MySQL Server 8.0\Data
From my .err code (no idea why it is in my download folder while MySQL Server is installed in C drive):
2020-05-02T04:17:52.952456Z 0 [System] [MY-010116] [Server] C:\Users\ME\Downloads\mysql-8.0.19-winx64 (2)\mysql-8.0.19-winx64\bin\mysqld (mysqld 8.0.19) starting as process 5928
2020-05-02T04:17:53.320285Z 1 [ERROR] [MY-011011] [Server] Failed to find valid data directory.
2020-05-02T04:17:53.352381Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2020-05-02T04:17:53.353424Z 0 [ERROR] [MY-010119] [Server] Aborting
2020-05-02T04:17:53.357792Z 0 [System] [MY-010910] [Server] C:\Users\ME\Downloads\mysql-8.0.19-winx64 (2)\mysql-8.0.19-winx64\bin\mysqld: Shutdown complete (mysqld 8.0.19) MySQL Community Server - GPL.
Much appreciated for MySQL Guru's advices!

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.