This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-15. For the latest, interactive version please visit https://mariadb.com/kb/.

sock error

I Built a lightsail Linux LAMP php 8 (debain 11) server and installed MariaDB. Did the following

Sudo apt update sudo apt install mariadb-server sudo systemctl start mariadb sudo systemctl start mariadb rebooted Server

everything looks fine systemctl status mariadb ● mariadb.service - MariaDB 10.5.19 database server Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2023-08-09 16:19:40 UTC; 1h 12min ago Docs: man:mariadbd(8) https://mariadb.com/kb/en/library/systemd/ Process: 562 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS) Process: 574 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS) Process: 591 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`cd /usr/bin/..; /usr/bin/galera_recover> Process: 719 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS) Process: 721 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS) Main PID: 663 (mariadbd) Status: "Taking your SQL requests now..." Tasks: 8 (limit: 2311) Memory: 107.1M CPU: 1.414s CGroup: /system.slice/mariadb.service └─663 /usr/sbin/mariadbd

Aug 09 16:19:40 ip-172-26-2-142 mariadbd[663]: 2023-08-09 16:19:40 0 [Note] InnoDB: Buffer pool(s) load completed at 230809 16:19:40 Aug 09 16:19:40 ip-172-26-2-142 mariadbd[663]: 2023-08-09 16:19:40 0 [Note] Server socket created on IP: '127.0.0.1'. Aug 09 16:19:40 ip-172-26-2-142 mariadbd[663]: 2023-08-09 16:19:40 0 [Note] Reading of all Master_info entries succeeded Aug 09 16:19:40 ip-172-26-2-142 mariadbd[663]: 2023-08-09 16:19:40 0 [Note] Added new Master_info '' to hash table Aug 09 16:19:40 ip-172-26-2-142 mariadbd[663]: 2023-08-09 16:19:40 0 [Note] /usr/sbin/mariadbd: ready for connections. Aug 09 16:19:40 ip-172-26-2-142 mariadbd[663]: Version: '10.5.19-MariaDB-0+deb11u2' socket: '/run/mysqld/mysqld.sock' port: 3306 > Aug 09 16:19:40 ip-172-26-2-142 systemd[1]: Started MariaDB 10.5.19 database server. Aug 09 16:19:40 ip-172-26-2-142 /etc/mysql/debian-start[723]: Upgrading MySQL tables if necessary. Aug 09 16:19:40 ip-172-26-2-142 /etc/mysql/debian-start[735]: Checking for insecure root accounts. Aug 09 16:19:40 ip-172-26-2-142 /etc/mysql/debian-start[739]: Triggering myisam-recover for all MyISAM tables and aria-recover for a>

When I run mysql -u root -p I put in the passworod and I get this

ERROR 2002 (HY000): Can't connect to local server through socket '/opt/bitnami/mariadb/tmp/mysql.sock' (2) when I go to that directory there are no files.

in the my.cnf file the path it /run/mysqld which has the mysqld.pid and mysql.sock files.

Ran this ps -ef | grep mysql* mysql 1812 1 0 17:45 ? 00:00:00 /usr/sbin/mariadbd root 2038 1618 0 18:04 pts/0 00:00:00 grep mysql*

How do I get this to work and have the files in the correct place and the ini and cnp files point to the correct place. very frustrating.

I's a simple database to run Machforms

Thanks for any insight I can get.

Answer Answered by Daniel Black in this comment.

Why do you have a bitnami config file for the socket path outside the container?

Run mariadb --help and you'll see:

Default options are read from the following files in the given order: /etc/my.cnf /etc/mysql/my.cnf /.my.cnf

Check these files for the bitnami path and remove it.

Or mariadb --no-defaults will ignore all configuration files.

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.