Pod Error: bitnami mysql helm chart on MacOS - mysql

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.

Related

Mysql not starting on docker

I'm using laravel sail to launch a statamic website on my local machine (macOS). All packages are up-to-date and launch correctly however, the mysql service starts, then fails due to "another process with pid 62 is using unix socket file.".
I'm using the default sail docker-compose file, uneditted. It is working on my other, linux machine correctly with no issues. When visiting localhost, I'm met with "SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for mysql failed: Name or service not known" which makes me think that it is connecting somehow as I would normally expect connection refused?
Here are the docker mysql container logs:
[Entrypoint] MySQL Docker Image 8.0.32-1.2.11-server
[Entrypoint] Starting MySQL 8.0.32-1.2.11-server
2023-01-26T21:17:04.876429Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2023-01-26T21:17:04.878708Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.32) starting as process 1
2023-01-26T21:17:04.885183Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-01-26T21:17:05.037353Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-01-26T21:17:05.189336Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2023-01-26T21:17:05.189362Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2023-01-26T21:17:05.189506Z 0 [ERROR] [MY-010259] [Server] Another process with pid 62 is using unix socket file.
2023-01-26T21:17:05.189518Z 0 [ERROR] [MY-010268] [Server] Unable to setup unix socket lock file.
2023-01-26T21:17:05.189521Z 0 [ERROR] [MY-010119] [Server] Aborting
2023-01-26T21:17:06.724573Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.32) MySQL Community Server - GPL.
Thanks in advance.
I solve mine (WSL2, Docker Desktop) by opening the Docker Desktop GUI, opened the Volumes sidebar. Search for all volume that has "mysql" on their name and delete those volumes. Then run docker compose up again.

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.

mysql installation with datadir home directory of user giving permission denied error 13

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

mysql : unable to create secondary server instance using mysqld

I am using mysqld to create an new server along with the existing one[ MYSQL 8.0.27 installed with the windows installer] to test data replication
I already have an instance of the server installed [called Mysql80] which is the original server and i am trying to create another server called MyTest using mysqld by reading this documentation which seems simple enough
i have created an empty Data directory to hold my new database and my configuration file for the server is saved as conf.cnf
[MyTest]
port = 3310
datadir = E:/Program Files/Developer/MYSQL/Data/TestFolder/Data
from the windows command line i create the server using their exact instructions
mysqld --defaults-file=E:/conf.cnf --console
--console is used to display debugging information but i always get these error's
021-12-12T17:17:11.844725Z 0 [System] [MY-010116] [Server] E:\Program Files\Developer\MYSQL\Server 8.0\bin\mysqld.exe (mysqld 8.0.27) starting as process 2328
2021-12-12T17:17:11.875406Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-12-12T17:17:13.498780Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
mysqld: Table 'mysql.plugin' doesn't exist
2021-12-12T17:17:13.866706Z 0 [ERROR] [MY-010735] [Server] Could not open the mysql.plugin table. Please perform the MySQL upgrade procedure.
2021-12-12T17:17:13.867207Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2021-12-12T17:17:13.867617Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2021-12-12T17:17:13.868042Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2021-12-12T17:17:13.868519Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2021-12-12T17:17:13.868926Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2021-12-12T17:17:13.869354Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2021-12-12T17:17:13.869707Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2021-12-12T17:17:13.979431Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2021-12-12T17:17:14.140027Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2021-12-12T17:17:14.172455Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1 is enabled for channel mysql_main
2021-12-12T17:17:14.172592Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1.1 is enabled for channel mysql_main
2021-12-12T17:17:14.175122Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-12-12T17:17:14.175319Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-12-12T17:17:14.176633Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Only one usage of each socket address (protocol/netwo k address/port) is normally permitted.
2021-12-12T17:17:14.176755Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 3306 ?
2021-12-12T17:17:14.177195Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-12-12T17:17:15.446688Z 0 [System] [MY-010910] [Server] E:\Program Files\Developer\MYSQL\Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.27) MySQL Community Server - GPL.
Ignoring the optimizer error's and cannot find table error's the server always tries to start on port 3306 even though i have specified in my conf file it should be on port 3310
Which makes me believe that i typed the config file in the wrong format or i haven't specified enough parameters for the job
any ideas?
Turns out i was doing two things wrong
I had previously upgraded from mysql 8 to 8.27 hence tables were corrupted which explained the Optimization errors
My config wasn't in the correct format
After deleting the MySQL service from windows services and deleting my data directory these 3 steps need to be performed in order
Create an new directory to store Data, your config file , upload directory[To Use commands like LOAD FILE]
The structure looks like this
->Warehouse1
|--->Data
|--->Uploads
|--->MyConfig.cnf
Where MyConfig.cnf looks as follows
[mysqld]
basedir="E:\Program Files\Developer\MYSQL\Server 8.0"
port=3306
datadir="E:\Program Files\Developer\MYSQL\Storage\WareHouse1\Data"
secure-file-priv="E:\Program Files\Developer\MYSQL\Storage\WareHouse1\Uploads"
2)Initialize the data directory from your windows command line using mysqld as follows
mysqld --defaults-file="E:\Program Files\Developer\MYSQL\Storage\WareHouse1\config.cnf" --initialize
3)Finally create an service which you can change in Windows Services window
mysqld --install MySQL81 --defaults-file="E:\Program Files\Developer\MYSQL\Storage\WareHouse1\config.cnf"
Repeat the same steps to create an second server.

msqld: Can't change dir (OS errno 13 - Permission denied)

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}"