MariaDB won't start after fresh install. No errors, no logs
Please execute:
service mariadb restart; journalctl -xe
So you can ensure no other messages will push mysql/mariadb output outside the view of -xe.
Maybe database never got initialized.
So it might help to know the content of /etc/my.cnf.
let uns know, where datadir is located.
datadir = /var/lib/mysql
But afaik it changes in some distribution and version to /var/lib/mariadb
If datadir is set and, very important: data dir is empty and database no running:
execute mysql_install_db manually.
** Maybe datadir must be changed.
chown -R mysql:mysql /var/lib/mysql
then try it again:
service mariadb start; journalctl -xe
Maybe use this as initial my.cnf
# This is default example of MySQL/MariaDB configuration provided with openSUSE package
# It is based on upstream defaults with some additional examples.
# The following options will be passed to all MariaDB clients
[client]
# password = your_password
# port = 3306
# socket = /var/run/mysql/mysql.sock
[xtrabackup]
target_dir = /DATA/BACKUP/mysql
datadir = /var/lib/mysql/
[mysqld]
socket = /var/lib/mysql/mysql.sock
innodb_buffer_pool_size = 20G
innodb_file_format = Barracuda
innodb_file_per_table = ON
innodb_buffer_pool_instances = 20
innodb_thread_concurrency = 4
innodb_purge_threads = 4
innodb_strict_mode = 1
innodb_old_blocks_time = 1000
innodb_stats_on_metadata = 0
innodb_write_io_threads = 4
innodb_read_io_threads = 4
innodb_io_capacity = 200000
innodb_open_files = 10000
innodb_log_file_size = 1G
innodb_log_buffer_size = 1G
innodb_log_files_in_group = 3
transaction-isolation = READ-COMMITTED
server-id = 1
#skip-networking
bind-address = 0.0.0.0
log_bin = master-mysql-bin
back_log = 500
concurrent_insert = ALWAYS
expire_logs_days = 10
delay-key-write = ALL
myisam-recover-options = FORCE,BACKUP
key_buffer_size = 512M
join_buffer_size = 256M
max_allowed_packet = 128M
max_heap_table_size = 1024M
tmp_table_size = 1024M
thread_stack = 192K
table_open_cache = 10240
table_definition_cache = 10240
open_files_limit = 100000
net_retry_count = 16384
query_cache_type = 0
query_cache_size = 0M
query_cache_limit = 0M
query_cache_min_res_unit = 1K
thread_cache_size = 100
max_connections = 100
ft_max_word_len = 20
ft_min_word_len = 3
long_query_time = 5
local-infile = 0
log-warnings = 2
performance_schema = ON
log-slave-updates
log-queries-not-using-indexes
skip-external-locking
skip-symbolic-links
skip-name-resolve
!includedir /etc/my.cnf.d
And then start mysql / mariadb manually:
# To ensure the service is stoppen:
service mariadb stop
/usr/sbin/mysqld --defaults-file=/etc/my.cnf --user=mysql
Related videos on Youtube
xenom
Updated on September 18, 2022Comments
-
xenom over 1 year
I just installed MariaDB from the debian repo and I can't start it.
root@Debian9A1:~$ mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket'/var/run/mysqld/mysqld.sock' (2)
I tried to launch the service, no success :
root@Debian9A1:/var/log/mysql# systemctl start mariadb Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.
Service status is not useful :
root@Debian9A1:/var/log/mysql# systemctl status mariadb.service ● mariadb.service - MariaDB 10.3.15 database server Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Mon 2019-07-22 16:28:51 CEST; 24s ago Docs: man:mysqld(8) https://mariadb.com/kb/en/library/systemd/ Process: 3987 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exit juil. 22 16:28:51 Debian9A1 systemd[1]: Starting MariaDB 10.3.15 database server... juil. 22 16:28:51 Debian9A1 systemd[1]: mariadb.service: Control process exited, code=exited status juil. 22 16:28:51 Debian9A1 systemd[1]: Failed to start MariaDB 10.3.15 database server. juil. 22 16:28:51 Debian9A1 systemd[1]: mariadb.service: Unit entered failed state. juil. 22 16:28:51 Debian9A1 systemd[1]: mariadb.service: Failed with result 'exit-code'.
Neither is journalctl :
root@Debian9A1:/var/log/mysql# journalctl -xe [...] juil. 22 16:28:51 Debian9A1 systemd[1]: Starting MariaDB 10.3.15 database server... -- Subject: L'unité (unit) mariadb.service a commencé à démarrer -- Defined-By: systemd -- Support: https://www.debian.org/support -- -- L'unité (unit) mariadb.service a commencé à démarrer. juil. 22 16:28:51 Debian9A1 systemd[1]: mariadb.service: Control process exited, code=exited status=127 juil. 22 16:28:51 Debian9A1 systemd[1]: Failed to start MariaDB 10.3.15 database server. -- Subject: L'unité (unit) mariadb.service a échoué -- Defined-By: systemd -- Support: https://www.debian.org/support -- -- L'unité (unit) mariadb.service a échoué, avec le résultat failed. juil. 22 16:28:51 Debian9A1 systemd[1]: mariadb.service: Unit entered failed state. juil. 22 16:28:51 Debian9A1 systemd[1]: mariadb.service: Failed with result 'exit-code'.
Finally, I don't have anything in the file /var/log/mysql/error.log
Do you have any ideas to help me troubleshoot the problem ? I already tried to reinstall all packages with :
apt-get --purge remove "mysql*" apt-get --purge remove "mariadb*"
It was not helpful
-
Michael Hampton almost 5 yearsCheck MariaDB's own log file.
-
asktyagi almost 5 yearscheck this serverfault.com/questions/812719/mysql-mariadb-not-starting follow if you don't have data(else be prepare).
-
xenom almost 5 years@MichaelHampton I don't have anything in /var/log
-
xenom almost 5 years@SteveKrawcke I already posted journalctl which gives nothing
-
xenom almost 5 years@asktyagi sadly, I also deleted everything in /var/lib/mysql before reinstalling without success
-
-
xenom almost 5 yearsjournalctl -xe was described in my first post, it gives absolutely nothing interesting except "it failed".. my.cnf is nearly empty and indicates only other conf directory. I tried to reinstall the db and change the permissions without success. I am so upset not being able to get any clue from the error message or the logs.
-
MWE almost 5 yearsMaybe this article will help you in the first steps: mariadb.com/kb/en/library/what-to-do-if-mariadb-doesnt-start
-
MWE almost 5 years@xenom, did it work?
-
SamErde almost 3 yearsPlease explain what your steps do to the system, and why they help. In this case, the OP has already installed.
-
phocks over 2 yearsThanks, it was
chown -R mysql:mysql /var/lib/mysql
that did it for me.