Starting MySQL.2021-11-17T11:04:25.022108Z mysqld_safe error: log-error set to '/var/log/mariadb/mariadb.log', however file don't exists. Create writable for user 'mysql'.
ERROR! The server quit without updating PID file (/data/mysql/data/localhost.localdomain.pid).
After msyql8 compilation and installation, start MySQL with/etc/init.d/mysqld start command. The above errors are reported, and then I rechecked the content of my.cnf, as follows:
[mysqld]
server-id=1
port=3306
datadir=/data/mysql/data
basedir=/usr/local/mysql
socket=/usr/local/mysql/mysql.sock
skip-grant-tables
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
[client]
socket=/usr/local/mysql/mysql.sock
[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
There is no problem with the overall configuration of my.cnf, and then the startup fails all the time. Finally, it is found that it is the log directory configured by mysqld_safe was not created
[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
So create authorization directly
Note: the path of log error I configured here is under/var/log/MariaDB. The created path is configured according to its own actual path. Be sure not to forget to create mariadb.log, otherwise an error will be reported
mkdir /var/log/mariadb
touch /var/log/mariadb/mariadb.log
MySQL users and users authorize directories
chown -R mysql:mysql /var/log/mariadb/
Start the MySQL service again
/usr/local/mysql/support-files/mysql.server start
perhaps
/etc/init.d/mysqld start
Other startup methods are implemented according to their actual situation
Read More:
- [Solved] mariadb Startup Error: Job for mariadb.service failed because the control process exited with error code.
- ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’
- Centos7 Initialize mysql Error: Could not open file ‘/usr/local/mysql/log/mysqld.log‘ for error logging: Per
- [Solved] Worker 1 failed executing transaction ‘ANONYMOUS‘ at master log mall-mysql-bin.000001, end_log_pos
- [Solved] ERROR 2002 (HY000): Can’t connect to local MySQL server through socket’/var/lib/mysql/mysql.sock’ (2)
- How to Solve can‘t connect to local mysql server through socket ‘/var/lib/mysql/mysql.sock‘
- [Solved] MySQL Startup Error: Job for mysqld.service failed because the control process exited with error code
- MYSQL Safe Upgraded Error: You are using safe update mode and you tried to update
- [Solved] Canal Error: Could not find first log file name in binary log index file
- RECEIVED ERROR PACKET: ERRNO = 1236, SQLSTATE = HY000 ERRMSG = COULD NOT FIND FIRST LOG FILE NAME IN BINARY LOG INDEX FILE
- ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’
- [Solved] Mysql Close safe-updates Mode Error: Error Code: 1175
- [Solved] MYSQL Command Execute Error: Can ‘t connect to local MySQL server through socket ‘/tmp/mysql.sock ‘(2) “
- [Solved] CentOS installs MySQL and starts MySQL with error 2002 (HY000)
- Dbeaver Import SQL File Error: Error executing process Process failed (exit code = 1). See error log. Process failed (exit code = 1). See error log.
- How to Solve mysqld — console command error
- [Solved] MySQL Startup Error: The server quit without updating PID file
- MySql Install Error: Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘
- ERROR: mysqld failed while attempting to check config [How to Solve]
- MYSQL Slave is not configured or failed to initialize properly. You must at least set –server-id