Microk8s mysql mysql.sock not found error?

Viewed 141

I'm trying to build a mysql on microk8s. I get the following error when I connect to the nfs server or not. Although I have given the permissions of the file directories (chmod -R 777 .) on the nfs server and also on the local, I can't get rid of getting the error. I'm getting an error in mysql, which I installed and ran without any problems before. The image I am using = docker.io/bitnami/mysql:8.0.23-debian-10-r0

Events:
  Type     Reason     Age               From               Message
  ----     ------     ----              ----               -------
  Normal   Scheduled  86s               default-scheduler  Successfully assigned gib/mysql-primary-0 to localhost.localdomain
  Normal   Pulled     85s               kubelet            Container image "docker.io/bitnami/mysql:8.0.23-debian-10-r0" already present on machine
  Normal   Created    85s               kubelet            Created container mysql
  Normal   Started    84s               kubelet            Started container mysql
  Warning  Unhealthy  7s (x5 over 46s)  kubelet            Readiness probe failed: mysqladmin: [Warning] Using a password on the command line interface can be insecure.
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/opt/bitnami/mysql/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/opt/bitnami/mysql/tmp/mysql.sock' exists!

Describe image as above. When I enter the pod, there is no mysql.sock in this path. I get this error on both rocky linux and ubuntu 20.04. My conf file is as follows. /etc/my.cnf does not occur in the server.

apiVersion: v1
kind: ConfigMap
metadata:
  name: mysql-config
  namespace: gib
data:
  
  my.cnf: |-
      [mysqld]
      default_authentication_plugin=mysql_native_password
      skip-name-resolve
      explicit_defaults_for_timestamp
      basedir=/opt/bitnami/mysql
      plugin_dir=/opt/bitnami/mysql/plugin
      port=3306
      socket=/opt/bitnami/mysql/tmp/mysql.sock
      tmpdir=/opt/bitnami/mysql/tmp
      max_allowed_packet=16M
      bind-address=0.0.0.0
      pid-file=/opt/bitnami/mysql/tmp/mysqld.pid
      log-error=/opt/bitnami/mysql/logs/mysqld.log
      character-set-server=utf8
      collation-server=utf8_bin
      max_connections=650
      innodb_flush_log_at_trx_commit=0
      innodb_rollback_on_timeout = ON
      innodb_buffer_pool_size=512M
      [client]
      port=3306
      socket=/opt/bitnami/mysql/tmp/mysql.sock
      default-character-set=UTF8
      plugin_dir=/opt/bitnami/mysql/plugin
      [manager]
      port=3306
      socket=/opt/bitnami/mysql/tmp/mysql.sock
      pid-file=/opt/bitnami/mysql/tmp/mysqld.pid

The logs of my mysql pod are as follows. Then the pod restarted.

mysql 18:28:17.19
mysql 18:28:17.21 Welcome to the Bitnami mysql container
mysql 18:28:17.21 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-mysql
mysql 18:28:17.21 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-mysql/issues
mysql 18:28:17.22
mysql 18:28:17.22 INFO  ==> ** Starting MySQL setup **
mysql 18:28:17.24 INFO  ==> Validating settings in MYSQL_*/MARIADB_* env vars
mysql 18:28:17.29 INFO  ==> Initializing mysql database
mysql 18:28:17.37 WARN  ==> The mysql configuration file '/opt/bitnami/mysql/conf/my.cnf' is not writable. Configurations based on environment variables will not be applied for this file.
mysql 18:28:17.38 INFO  ==> Installing database
mysql 18:30:33.33 INFO  ==> Starting mysql in background
mysql 18:30:41.68 INFO  ==> Configuring authentication
mysql: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.
mysql 18:30:44.40 INFO  ==> Configuring replication in master node
mysql 18:30:45.04 INFO  ==> Running mysql_upgrade
mysql 18:30:45.04 INFO  ==> Stopping mysql
mysql 18:30:52.08 INFO  ==> Starting mysql in background

I couldn't find what the problem was, even though I've installed without problems before. Many people have encountered this error, but the solutions did not work for me. Can you help me to solve this error I got in mysql on microk8s?

0 Answers
Related