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.
Related
In my local environment when using Rancher Desktop on MacOS
With default configurations
Run helm install my-release bitnami/mysql
See Error...
% kubectl get pods
NAME READY STATUS RESTARTS AGE
my-release-mysql-0 0/1 CrashLoopBackOff 6 (3m12s ago) 8m57s
% kubectl logs my-release-mysql-0
/usr/lib: './var/cache/ldconfig': Permission denied
/usr/lib: './proc/tty/driver': Permission denied
/usr/lib: './root': Permission denied
/usr/lib: './etc/ssl/private': Permission denied
mysql Wed Aug 24 23:07:43 UTC 2022INFO ==> ** Starting MySQL **
2022-08-24T23:07:43.299737Z 0 [Warning] [MY-010939] [Server] Failed to get absolute path of program executable --defaults-file=/opt/bitnami/mysql/conf/my.cnf
2022-08-24T23:07:43.933997Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2022-08-24T23:07:43.934191Z 0 [System] [MY-010116] [Server] --defaults-file=/opt/bitnami/mysql/conf/my.cnf (mysqld 8.0.30) starting as process 1
2022-08-24T23:07:43.953718Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
2022-08-24T23:07:43.954132Z 0 [Warning] [MY-013244] [Server] --collation-server: 'utf8mb3_general_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead.
2022-08-24T23:07:43.956530Z 0 [Warning] [MY-010091] [Server] Can't create test file /bitnami/mysql/data/mysqld_tmp_file_case_insensitive_test.lower-test
2022-08-24T23:07:43.956655Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /bitnami/mysql/data/ is case insensitive
2022-08-24T23:07:43.957378Z 0 [ERROR] [MY-013276] [Server] Failed to set datadir to '/bitnami/mysql/data/' (OS errno: 2 - No such file or directory)
2022-08-24T23:07:43.958983Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-08-24T23:07:43.962276Z 0 [System] [MY-010910] [Server] --defaults-file=/opt/bitnami/mysql/conf/my.cnf: Shutdown complete (mysqld 8.0.30) Source distribution.
NOTE: When I run this same thing on my Ubuntu 20.04 machine it works just fine.
It turned out to be a permissions issue. Once I had admin permissions set properly, I updated RD and everything worked as it should.
I am trying to initialize the mysql and datadir=/home/user/mysqldata
but it is througing the error permission denied
root#localhost mysql]# bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/home/user/mysql-data
2021-11-23T17:35:24.562009Z 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.
2021-11-23T17:35:24.562124Z 0 [System] [MY-013169] [Server] /usr/local/mysql-8.0.27-linux-glibc2.12-x86_64/bin/mysqld (mysqld 8.0.27) initializing of server in progress as process 56149
2021-11-23T17:35:24.564873Z 0 [ERROR] [MY-013276] [Server] Failed to set datadir to '/home/user/mysql-data/' (OS errno: 13 - Permission denied)
2021-11-23T17:35:24.564881Z 0 [ERROR] [MY-013236] [Server] The designated data directory /home/user/mysql-data/ is unusable. You can remove all files that the server added to it.
2021-11-23T17:35:24.564978Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-11-23T17:35:24.565137Z 0 [System] [MY-010910] [Server] /usr/local/mysql-8.0.27-linux-glibc2.12-x86_64/bin/mysqld: Shutdown complete (mysqld 8.0.27) MySQL Community Server - GPL.```
I create a folder /home/user/mysql-data and changed the ownership to mysql and changed the mode also to 750/777 also.
Also disabled selinux, Os is centos 6.9
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
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.
I installed mysql for Mac 10.14 using the .dmg file at the top here: https://dev.mysql.com/downloads/mysql/, and ran through the installer. My system os is Mac 10.13.6, but there is a note that says this should work.
At /usr/local/ there's both a mysql folder and a mysql-8.0.13-macos10.14-x86_64 folder.
When I run mysqld I get the following error:
mysqld: Can't change dir to '/usr/local/mysql-8.0.13-macos10.14-x86_64/data/' (OS errno 13 - Permission denied)
ts 0 [System] [MY-010116] [Server] /usr/local/mysql-8.0.13-macos10.14-x86_64/bin/mysqld (mysqld 8.0.13) starting as process 9863
ts 0 [Warning] [MY-010091] [Server] Can't create test file /usr/local/mysql-8.0.13-macos10.14-x86_64/data/Monicas-MacBook-Pro.lower-test
ts 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/mysql-8.0.13-macos10.14-x86_64/data/ is case insensitive
ts 0 [ERROR] [MY-010172] [Server] failed to set datadir to /usr/local/mysql-8.0.13-macos10.14-x86_64/data/
ts 0 [ERROR] [MY-010119] [Server] Aborting
ts 0 [System] [MY-010910] [Server] /usr/local/mysql-8.0.13-macos10.14-x86_64/bin/mysqld: Shutdown complete (mysqld 8.0.13) MySQL Community Server - GPL.
ts is the UTC timestamp.
Is the problem that the command mysqld comes from /usr/local/mysql/ and the directory to write to /usr/local/mysql-8.0.13...../data/? Does my user on my work computer not have the correct permissions to write to these directories?
I've tried sudo:
Please read "Security" section of the manual to find out how to run mysqld as root!
Restart computer.
If that doesn't work:
If you are in a virtualenv try installing required python-to-mysql libraries globally, that also helped.
The final thing to try is
export DYLD_LIBRARY_PATH="/usr/local/mysql/lib/:${DYLD_LIBRARY_PATH}"