i cannot start my mysql server, it crashed all a sudden and i can not find any useful log to say why.
my disk has still some space left, several Gigabytes.
last logs from journalctl -feu mysql are like this, which doesnt help at all:
May 06 16:04:23 soy systemd[1]: Starting MySQL Community Server...
May 06 16:04:23 soy su[5927]: Successful su for mysql by root
May 06 16:04:23 soy su[5927]: + ??? root:mysql
May 06 16:04:23 soy su[5927]: pam_unix(su:session): session opened for user mysql by (uid=0)
May 06 16:04:23 soy su[5927]: pam_unix(su:session): session closed for user mysql
May 06 16:04:24 soy systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
May 06 16:04:24 soy systemd[1]: mysql.service: Failed with result 'exit-code'. May 06 16:04:24 soy systemd[1]: Failed to start MySQL Community Server.
mysql version 8
mysql Ver 8.0.20 for Linux on x86_64 (MySQL Community Server - GPL)
Linux soy 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic
and here the service info:
service mysql status
● mysql.service - MySQL Community Server Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Wed 2020-05-06 16:04:24 UTC; 7min ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html Process: 5961 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE) Process: 5876 ExecStartPre=/usr/share/mysql-8.0/mysql-systemd-start pre (code=exited, status=0/SUCCESS) Main PID: 5961 (code=exited, status=1/FAILURE) Status: "Server startup in progress"
May 06 16:04:23 soy systemd[1]: Starting MySQL Community Server...
May 06 16:04:23 soy su[5927]: Successful su for mysql by root
May 06 16:04:23 soy su[5927]: + ??? root:mysql
May 06 16:04:23 soy su[5927]: pam_unix(su:session): session opened for user mysql by (uid=0)
May 06 16:04:23 soy su[5927]: pam_unix(su:session): session closed for user mysql
May 06 16:04:24 soy systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
May 06 16:04:24 soy systemd[1]: mysql.service: Failed with result 'exit-code'.
May 06 16:04:24 soy systemd[1]: Failed to start MySQL Community Server.
error log:
020-05-07T07:55:44.761003Z 0 [System] [MY-013169] [Server]
/usr/sbin/mysqld (mysqld 8.0.20) initializing of server in progress as
process 2024 2020-05-07T07:55:44.762802Z 0 [ERROR] [MY-010457]
[Server] --initialize specified but the data directory has files in
it. Aborting. 2020-05-07T07:55:44.762827Z 0 [ERROR] [MY-013236]
[Server] The designated data directory /var/lib/mysql/ is unusable.
You can remove all files that the server added to it.
2020-05-07T07:55:44.762887Z 0 [ERROR] [MY-010119] [Server] Aborting
2020-05-07T07:55:44.762984Z 0 [System] [MY-010910] [Server]
/usr/sbin/mysqld: Shutdown complete (mysqld 8.0.20) MySQL Community
Server - GPL. 2020-05-07T07:55:45.026958Z 0 [System] [MY-010116]
[Server] /usr/sbin/mysqld (mysqld 8.0.20) starting as process 2032
2020-05-07T07:55:45.041675Z 1 [ERROR] [MY-011011] [Server] Failed to
find valid data directory. 2020-05-07T07:55:45.041828Z 0 [ERROR]
[MY-010020] [Server] Data Dictionary initialization failed.
2020-05-07T07:55:45.041889Z 0 [ERROR] [MY-010119] [Server] Aborting
2020-05-07T07:55:45.042277Z 0 [System] [MY-010910] [Server]
/usr/sbin/mysqld: Shutdown complete (mysqld 8.0.20) MySQL Community
Server - GPL. 2020-05-07T07:55:45.298208Z 0 [System] [MY-010116]
[Server] /usr/sbin/mysqld (mysqld 8.0.20) starting as process 2040
2020-05-07T07:55:45.305008Z 1 [ERROR] [MY-011011] [Server] Failed to
find valid data directory. 2020-05-07T07:55:45.305180Z 0 [ERROR]
[MY-010020] [Server] Data Dictionary initialization failed.
2020-05-07T07:55:45.305248Z 0 [ERROR] [MY-010119] [Server] Aborting
2020-05-07T07:55:45.305563Z 0 [System] [MY-010910] [Server]
/usr/sbin/mysqld: Shutdown complete (mysqld 8.0.20) MySQL Community
Server - GPL.
it says it cannot create a test file, but i have no idea why.
maybe unattended-upgrades broken rights.
the var/lib/mysql folder is owned by mysql user and group. so no idea why it couldnt make files in here.
thats really tricky.
Related
While Restarting the MySQL server version 8.0.30 it is getting failed and couldn't able to fix the issue till now.
ESCOD
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sat 2022-12-31 08:37:07 GMT; 1h 7min ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 631823 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS (code=exited, status=1/FAILURE)
Process: 631795 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 631823 (code=exited, status=1/FAILURE)
Status: "Server shutdown complete"
Dec 31 08:37:06 fcg-db-mysql-oracle-lx-129.142 systemd[1]: Starting MySQL Server...
Dec 31 08:37:07 fcg-db-mysql-oracle-lx-129.142 mysqld[631823]: 2022-12-31T08:37:07.614931Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.30) starting as process 631823
Dec 31 08:37:07 fcg-db-mysql-oracle-lx-129.142 mysqld[631823]: 2022-12-31T08:37:07.614964Z 0 [ERROR] [MY-010338] [Server] Can't find error-message file '/usr/share/mysql-8.0/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
Dec 31 08:37:07 fcg-db-mysql-oracle-lx-129.142 mysqld[631823]: 2022-12-31T08:37:07.620958Z 1 [ERROR] [MY-011011] [Server] Failed to find valid data directory.
Dec 31 08:37:07 fcg-db-mysql-oracle-lx-129.142 mysqld[631823]: 2022-12-31T08:37:07.621191Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
Dec 31 08:37:07 fcg-db-mysql-oracle-lx-129.142 mysqld[631823]: 2022-12-31T08:37:07.621215Z 0 [ERROR] [MY-010119] [Server] Aborting
Dec 31 08:37:07 fcg-db-mysql-oracle-lx-129.142 mysqld[631823]: 2022-12-31T08:37:07.621569Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.30) MySQL Community Server - GPL.
Dec 31 08:37:07 fcg-db-mysql-oracle-lx-129.142 systemd[1]: mysqld.service: Main process exited, code=exited, status=1/FAILURE
Dec 31 08:37:07 fcg-db-mysql-oracle-lx-129.142 systemd[1]: mysqld.service: Failed with result 'exit-code'.
Dec 31 08:37:07 fcg-db-mysql-oracle-lx-129.142 systemd[1]: Failed to start MySQL Server.
~
while from suggestions from some blogs i have tried mysqld --initialize --console, but it is also throwing error like below
mysqld: Can't create directory '/var/lib/mysql/' (OS errno 17 - File exists)
2022-12-31T18:12:49.257034Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.30) initializing of server in progress as process 3353
2022-12-31T18:12:49.257062Z 0 [Warning] [MY-010339] [Server] Using pre 5.5 semantics to load error messages from /usr/share/mysql-8.0/. If this is not intended, refer to the documentation for valid usage of --lc-messages-dir and --language parameters.
2022-12-31T18:12:49.257067Z 0 [ERROR] [MY-010342] [Server] Can't read from messagefile '/usr/share/mysql-8.0/errmsg.sys'
2022-12-31T18:12:49.257809Z 0 [ERROR] [MY-013236] [Server] The designated data directory /var/lib/mysql/ is unusable. You can remove all files that the server added to it.
2022-12-31T18:12:49.257841Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-12-31T18:12:49.257943Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.30) MySQL Community Server - GPL.
[fcgredim#fcg-db-mysql-oracle-lx-129 ~]$
Can anyone help on this?
1 . Run the below command to see if there are any errors in the file configuration.
mysqld --validate-config
Can't create directory '/var/lib/mysql/' (OS errno 17 - File exists)
2 . The above error indicates that something wrong with /var/lib/mysql/. Check if this path exists, and it has this permission drwx------ mysql mysql. (Also, if SElinx installed, check if it has the right label)
Connection to the MySQL db was working fine 2 weeks ago, and without any editing or development activity it dropped out. I am using SQL Workbench to access. I can connect to the AWS EC2 instance via the AWS dashboard as well as SSH tunnel, can view/access files from filezilla connection.
The server is running WordPress application for a single website (https://farrahstribute.com/)
By examining past answers I tried:
(1) editing /etc/my.cnf and added this line
bind-address=0.0.0.0
after adding I rebooted server, however nothing changed, error with db persisting, so I removed the code I added
(2) editing /etc/hosts.allow and added these lines
mysqld: ALL : ALLOW
mysqld-max: ALL : ALLOW
after editing I rebooted server, however nothing changed, error with db persisting, so I removed the code that I added
From the terminal - this command systemctl status mysqld -l gave this result:
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2022-11-29 01:22:25 UTC; 14h ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 3152 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS (code=exited, status=1/FAILURE)
Process: 2906 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 3152 (code=exited, status=1/FAILURE)
Status: "Server shutdown complete"
Error: 13 (Permission denied)
Nov 29 01:22:20 ip-172-31-28-111.ec2.internal systemd[1]: Starting MySQL Server...
Nov 29 01:22:25 ip-172-31-28-111.ec2.internal mysqld[3152]: 2022-11-29T01:22:25.558132Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.31) starting as process 3152
Nov 29 01:22:25 ip-172-31-28-111.ec2.internal mysqld[3152]: 2022-11-29T01:22:25.615516Z 0 [ERROR] [MY-010187] [Server] Could not open file '/var/log/mysqld.log' for error logging: Permission denied
Nov 29 01:22:25 ip-172-31-28-111.ec2.internal mysqld[3152]: 2022-11-29T01:22:25.615582Z 0 [ERROR] [MY-010119] [Server] Aborting
Nov 29 01:22:25 ip-172-31-28-111.ec2.internal mysqld[3152]: 2022-11-29T01:22:25.640431Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.31) MySQL Community Server - GPL.
Nov 29 01:22:25 ip-172-31-28-111.ec2.internal systemd[1]: mysqld.service: main process exited, code=exited, status=1/FAILURE
Nov 29 01:22:25 ip-172-31-28-111.ec2.internal systemd[1]: Failed to start MySQL Server.
Nov 29 01:22:25 ip-172-31-28-111.ec2.internal systemd[1]: Unit mysqld.service entered failed state.
Nov 29 01:22:25 ip-172-31-28-111.ec2.internal systemd[1]: mysqld.service failed.
Also from the terminal ran: systemctl status mysqld.service with output:
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2022-11-29 15:42:23 UTC; 2min 7s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 7247 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS (code=exited, status=1/FAILURE)
Process: 7220 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 7247 (code=exited, status=1/FAILURE)
Status: "Server shutdown complete"
Error: 13 (Permission denied)
Nov 29 15:42:22 ip-172-31-28-111.ec2.internal systemd[1]: Starting MySQL Server...
Nov 29 15:42:23 ip-172-31-28-111.ec2.internal mysqld[7247]: 2022-11-29T15:42:23.292440Z 0 [System] [MY-010116] [Server...7247
Nov 29 15:42:23 ip-172-31-28-111.ec2.internal mysqld[7247]: 2022-11-29T15:42:23.296242Z 0 [ERROR] [MY-010187] [Server]...nied
Nov 29 15:42:23 ip-172-31-28-111.ec2.internal mysqld[7247]: 2022-11-29T15:42:23.297482Z 0 [ERROR] [MY-010119] [Server]...ting
Nov 29 15:42:23 ip-172-31-28-111.ec2.internal mysqld[7247]: 2022-11-29T15:42:23.297889Z 0 [System] [MY-010910] [Server...GPL.
Nov 29 15:42:23 ip-172-31-28-111.ec2.internal systemd[1]: mysqld.service: main process exited, code=exited, status=1/FAILURE
Nov 29 15:42:23 ip-172-31-28-111.ec2.internal systemd[1]: Failed to start MySQL Server.
Nov 29 15:42:23 ip-172-31-28-111.ec2.internal systemd[1]: Unit mysqld.service entered failed state.
Nov 29 15:42:23 ip-172-31-28-111.ec2.internal systemd[1]: mysqld.service failed.
I also examined the error log /var/log/nginx/farrahstribute_error.log and found this error:
2022/11/29 00:55:06 [error] 3111#3111: *39 access forbidden by rule, client: 54.152.255.102, server: farrahstribute.com, request: "GET /.env HTTP/1.1", host: "34.199.116.152"
the issue is this line:
[ERROR] [MY-010187] [Server] Could not open file '/var/log/mysqld.log' for error logging: Permission denied
Which is supported by this error message:
Error: 13 (Permission denied)
So the issue is permissions to the /var/log/mysqld.log file. What is needed is to create permissions for mysql to access this file - running this command with a server reboot solved this issue:
$ sudo chown mysql:mysql /var/log/mysqld.log
my os is Redhat8.
currtenly I install Mysql, version is "mysql Ver 8.0.13 for Linux on x86_64 (Source distribution)"
I use command "sudo yum install mysql, mysql-server"
But i get error when i want to start mysql services. I keep finding soluction, but still I don't know how to solved it.
Can anyone help me to look at it?
#--------------------------------------------------------------------------------------------------------
[yliu#rhlab1 ~]$ sudo systemctl start mysqld
Job for mysqld.service failed because the control process exited with error code.
See "systemctl status mysqld.service" and "journalctl -xe" for details.
# --------------------------------------------------------------------------------------------
[yliu#rhlab1 ~]$ sudo systemctl status mysqld
● mysqld.service - MySQL 8.0 database server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2020-02-19 12:12:15 AST; 15s ago
Process: 13080 ExecStopPost=/usr/libexec/mysql-wait-stop (code=exited, status=0/SUCCESS)
Process: 13052 ExecStart=/usr/libexec/mysqld --basedir=/usr (code=exited, status=1/FAILURE)
Process: 13015 ExecStartPre=/usr/libexec/mysql-prepare-db-dir mysqld.service (code=exited, status=0/SUCCESS)
Process: 12991 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS)
Main PID: 13052 (code=exited, status=1/FAILURE)
Status: "SERVER_BOOTING"
Error: 2 (No such file or directory)
Feb 19 12:12:12 systemd[1]: Starting MySQL 8.0 database server...
Feb 19 12:12:15 systemd[1]: mysqld.service: Main process exited, code=exited, status=1/FAILURE
Feb 19 12:12:15 systemd[1]: mysqld.service: Failed with result 'exit-code'.
Feb 19 12:12:15 systemd[1]: Failed to start MySQL 8.0 database server.
# ----------------------------------------------------------------------------------------
[yliu#rhlab1 ~]$ sudo cat /var/log/mysql/mysqld.log | nl | tail -n 10
38 2020-02-19T15:48:25.492390Z 0 [System] [MY-010910] [Server] /usr/libexec/mysqld: Shutdown complete (mysqld 8.0.13) Source distribution.
39 2020-02-19T15:48:25.492468Z 0 [ERROR] [MY-010065] [Server] Failed to shutdown components infrastructure.
40 2020-02-19T16:12:13.332724Z 0 [System] [MY-010116] [Server] /usr/libexec/mysqld (mysqld 8.0.13) starting as process 13052
41 2020-02-19T16:12:13.585641Z 1 [ERROR] [MY-010781] [Server] Found ./mysql/index_stats.frm file in mysql schema. DD will create .ibd file with same name. Please rename table and start upgrade process again.
42 2020-02-19T16:12:13.585666Z 1 [ERROR] [MY-010336] [Server] Found .frm file with same name as one of the Dictionary Tables.
43 2020-02-19T16:12:13.585833Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
44 2020-02-19T16:12:13.585871Z 0 [ERROR] [MY-013236] [Server] Newly created data directory /var/lib/mysql/ is unusable. You can safely remove it.
45 2020-02-19T16:12:13.585881Z 0 [ERROR] [MY-010119] [Server] Aborting
46 2020-02-19T16:12:15.000469Z 0 [System] [MY-010910] [Server] /usr/libexec/mysqld: Shutdown complete (mysqld 8.0.13) Source distribution.
47 2020-02-19T16:12:15.000550Z 0 [ERROR] [MY-010065] [Server] Failed to shutdown components infrastructure.
My /etc/my.cnf.d/mysql-server.cnf information is:
[yliu#rhlab1 ~]$ sudo cat /etc/my.cnf.d/mysql-server.cnf
#
# This group are read by MySQL server.
# Use it for options that only the server (but not clients) should see
#
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/en/server-configuration-defaults.html
# 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 mysqld according to the
# instructions in http://fedoraproject.org/wiki/Systemd
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
log-error=/var/log/mysql/mysqld.log
pid-file=/run/mysqld/mysqld.pid
I solved the problem, hope it will helpful for everyone who meet the same problem.
Base on the log:
41 2020-02-19T16:12:13.585641Z 1 [ERROR] [MY-010781] [Server] Found ./mysql/index_stats.frm file in mysql schema. DD will create .ibd file with same name. Please rename table and start upgrade process again.
42 2020-02-19T16:12:13.585666Z 1 [ERROR] [MY-010336] [Server] Found .frm file with same name as one of the Dictionary Tables.
43 2020-02-19T16:12:13.585833Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
44 2020-02-19T16:12:13.585871Z 0 [ERROR] [MY-013236] [Server] Newly created data directory /var/lib/mysql/ is unusable. You can safely remove it.
so we can remove all the files under /var/lib/mysql/
and then make sure the mysql file owner and group are mysql.
(Django) [yliu#rhlab1 ops]$ sudo ls -al /var/lib/ | grep mysql
drwxr-xr-x. 7 mysql mysql 4096 Feb 24 10:16 mysql
and then you can start mysqld again
sudo systemctl start mysqld
After installing mysql-community-server-8.0.17-1.el7.x86_64 on centos 7, I tried to run systemctl start mysqld which gave me this:
//ERROR MESSAGE 1
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.
Then I ran systemctl status mysqld.service -l and the result was:
mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sun 2019-09-29 22:54:21 IST; 1min 5s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 5025 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS (code=exited, status=1/FAILURE)
Process: 4991 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 5025 (code=exited, status=1/FAILURE)
Status: "Server startup in progress"
Error: 13 (Permission denied)
Sep 29 22:53:56 localhost.localdomain systemd[1]: Starting MySQL Server...
Sep 29 22:54:19 localhost.localdomain mysqld[5025]: 2019-09-29T17:24:19.458682Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.17) starting as process 5025
Sep 29 22:54:19 localhost.localdomain mysqld[5025]: 2019-09-29T17:24:19.575176Z 0 [ERROR] [MY-010187] [Server] Could not open file '/var/log/mysqld.log' for error logging: Permission denied
Sep 29 22:54:19 localhost.localdomain mysqld[5025]: 2019-09-29T17:24:19.625828Z 0 [ERROR] [MY-010119] [Server] Aborting
Sep 29 22:54:19 localhost.localdomain mysqld[5025]: 2019-09-29T17:24:19.626927Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.17) MySQL Community Server - GPL.
Sep 29 22:54:21 localhost.localdomain systemd[1]: mysqld.service: main process exited, code=exited, status=1/FAILURE
Sep 29 22:54:21 localhost.localdomain systemd[1]: Failed to start MySQL Server.
Sep 29 22:54:21 localhost.localdomain systemd[1]: Unit mysqld.service entered failed state.
Sep 29 22:54:21 localhost.localdomain systemd[1]: mysqld.service failed.
Then I changed to permission of mysql.log to 777 but after again starting mysqld I again received ERROR MESSAGE 1 (check above)
This time the status was:
mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sun 2019-09-29 22:56:14 IST; 8s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 5110 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS (code=exited, status=1/FAILURE)
Process: 5077 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 5110 (code=exited, status=1/FAILURE)
Status: "Server startup in progress"
Error: 2 (No such file or directory)
Sep 29 22:56:04 localhost.localdomain systemd[1]: Starting MySQL Server...
Sep 29 22:56:14 localhost.localdomain systemd[1]: mysqld.service: main process exited, code=exited, status=1/FAILURE
Sep 29 22:56:14 localhost.localdomain systemd[1]: Failed to start MySQL Server.
Sep 29 22:56:14 localhost.localdomain systemd[1]: Unit mysqld.service entered failed state.
Sep 29 22:56:14 localhost.localdomain systemd[1]: mysqld.service failed.
Then I checked /var/log/mysqld.log which contained:
2019-09-29T17:35:14.918779Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.17) initializing of server in progress as process 5295
2019-09-29T17:35:14.922106Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
2019-09-29T17:35:14.922221Z 0 [ERROR] [MY-013236] [Server] The designated data directory /var/lib/mysql/ is unusable. You can remove all files that the server added to it.
2019-09-29T17:35:14.922316Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-09-29T17:35:14.922661Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.17) MySQL Community Server - GPL.
Then I emptied the directory using rm /var/lib/mysql/* -rf, I emptied the mysqld.log and again tried to start mysqld then again ERROR MESSAGE 1 got printed and the log file contained this:
2019-09-29T17:41:57.989709Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-09-29T17:41:57.990134Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.17) MySQL Community Server - GPL.
2019-09-29T17:41:58.418384Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.17) starting as process 5657
2019-09-29T17:41:59.007005Z 1 [ERROR] [MY-011011] [Server] Failed to find valid data directory.
2019-09-29T17:41:59.007190Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2019-09-29T17:41:59.007326Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-09-29T17:41:59.008559Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.17) MySQL Community Server - GPL.
I understand it tons of data, what should I do?
Here is the error i am getting
mariadb.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled)
Active: failed (Result: exit-code) since Mon 2014-10-13 14:31:02 CEST; 10s ago
Process: 23609 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=1/FAILURE)
Process: 23608 ExecStart=/usr/bin/mysqld_safe --basedir=/usr (code=exited, status=0/SUCCESS)
Process: 23506 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
Main PID: 23608 (code=exited, status=0/SUCCESS)
Oct 13 14:30:59 localhost.localdomain mariadb-prepare-db-dir[23506]: Support MariaDB development by buying support/new features from
Oct 13 14:30:59 localhost.localdomain mariadb-prepare-db-dir[23506]: SkySQL Ab. You can contact us about this at sales#skysql.com.
Oct 13 14:30:59 localhost.localdomain mariadb-prepare-db-dir[23506]: Alternatively consider joining our community based development effort:
Oct 13 14:30:59 localhost.localdomain mariadb-prepare-db-dir[23506]: http://mariadb.com/kb/en/contributing-to-the-mariadb-project/
Oct 13 14:30:59 localhost.localdomain mysqld_safe[23608]: 141013 14:30:59 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
Oct 13 14:30:59 localhost.localdomain mysqld_safe[23608]: 141013 14:30:59 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Oct 13 14:31:02 localhost.localdomain mysqld_safe[23608]: 141013 14:31:02 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended
Oct 13 14:31:02 localhost.localdomain systemd[1]: mariadb.service: control process exited, code=exited status=1
Oct 13 14:31:02 localhost.localdomain systemd[1]: Failed to start MariaDB database server.
Oct 13 14:31:02 localhost.localdomain systemd[1]: Unit mariadb.service entered failed state.
THis is the mariadb.log file:
Im not really understanding this error, because the sock file has not been created and my server hasn't succesfully started...
141013 14:37:28 [ERROR] Can't start server : Bind on unix socket: Permission denied
141013 14:37:28 [ERROR] Do you already have another mysqld server running on socket: /var/run/mysql/mysql.sock ?
141013 14:37:28 [ERROR] Aborting
141013 14:37:28 InnoDB: Starting shutdown...
141013 14:37:29 InnoDB: Shutdown completed; log sequence number 1597945
141013 14:37:29 [Note] /usr/libexec/mysqld: Shutdown complete
I installed it fresh several times and I can't seem to figure out what the error is in the logs. I am running everything as root. Thanks.