Problems starting mysqld

br flag

When I try to start mysqld i get this error.. Any ideas on how to fix this? Should I run it as sudo? From some tutorial on internet they did not need to use sudo. I am using MYSQL community edition on Lubuntu 22.04

(base) alfredo@alfredo-hpelitebook725g4:~$ mysqld
2022-05-15T19:32:38.246287Z 0 [Warning] [MY-010091] [Server] Can't create test file /var/lib/mysql/mysqld_tmp_file_case_insensitive_test.lower-test
2022-05-15T19:32:38.246379Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.28) starting as process 10661
2022-05-15T19:32:38.249975Z 0 [Warning] [MY-010091] [Server] Can't create test file /var/lib/mysql/mysqld_tmp_file_case_insensitive_test.lower-test
2022-05-15T19:32:38.249987Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2022-05-15T19:32:38.250023Z 0 [ERROR] [MY-013276] [Server] Failed to set datadir to '/var/lib/mysql/' (OS errno: 13 - Permission denied)
2022-05-15T19:32:38.250157Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-05-15T19:32:38.253779Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.28)  MySQL Community Server - GPL.
(base) alfredo@alfredo-hpelitebook725g4:~$ 
Romeo Ninov avatar
in flag
Have you try to run it with `systemctl`? What is the result of `ls -ld /var/lib/mysql`?
in flag

mysqld is not intended to be run by a regular user. Start it via it's systemd unit.

sudo systemctl enable mysql
sudo systemctl start mysql

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.