I installed mariaDB under the path ‘/app/mysql’;
Since the configuration file could not be found, I created the 'my.cnf' file under the 'etc/mysql' path and copied the content online, my.cnf CODE:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
When I run the command systemctl start mariadb, no error seems to be reported, but systemctl status mariadb says it failed. Code:
[root@iZbp13edmlpcdqu2759ccaZ system]# systemctl status mariadb
● mariadb.service - MariaDB - database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2023-10-19 20:31:46 CST; 13s ago
Process: 115928 ExecStart=/app/mysql/bin/mysql -c /app/mysql (code=exited, status=1/FAILURE)
Main PID: 115928 (code=exited, status=1/FAILURE)
Oct 19 20:31:46 iZbp13edmlpcdqu2759ccaZ systemd[1]: Started MariaDB - database server.
Oct 19 20:31:46 iZbp13edmlpcdqu2759ccaZ systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Oct 19 20:31:46 iZbp13edmlpcdqu2759ccaZ systemd[1]: mariadb.service: Failed with result 'exit-code'.
mariadb.service code:
[Unit]
Description=MariaDB - database server
After=syslog.target
After=network.target
[Service]
Type=simple
User=mysql
Group=mysql
# ExecStartPre=/app/mysql/bin/mysql -t -c /app/mysql
ExecStart=/app/mysql/bin/mysql -c /app/mysql
ExecStop=/app/mysql/bin/mysql -s stop
PrivateTmp=true
[Install]
WantedBy=multi-user.target
I hope to start mariadb successfully. How should I modify it? Thanks for any help.
mysqland notmysqld?