One of the node can not start the mariadb in Galera Cluster - mysql

I have 3 nodes in my cluster, names: ha-node1, ha-node2, ha-node3.
The ha-node2 can not start the mariadb.service now, before is normal:
I use the below commands to show logs:
[root#ha-node2 ~]# systemctl status mariadb.service
● mariadb.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/mariadb.service.d
└─migrated-from-my.cnf-settings.conf
Active: failed (Result: timeout) since Mon 2017-07-31 12:00:33 CST; 13min ago
Process: 59147 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=killed, signal=TERM)
Process: 59138 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Jul 31 11:59:02 ha-node2 systemd[1]: Starting MariaDB database server...
Jul 31 12:00:33 ha-node2 systemd[1]: mariadb.service start-pre operation timed out. Terminating.
Jul 31 12:00:33 ha-node2 systemd[1]: Failed to start MariaDB database server.
Jul 31 12:00:33 ha-node2 systemd[1]: Unit mariadb.service entered failed state.
Jul 31 12:00:33 ha-node2 systemd[1]: mariadb.service failed.
And use journal -xe:
[root#ha-node2 ~]# journalctl -xe
Jul 31 12:14:49 ha-node2 attrd[2281]: notice: Removing all ha-node3 attributes for attrd_peer_change_cb
Jul 31 12:14:49 ha-node2 attrd[2281]: notice: Lost attribute writer ha-node3
Jul 31 12:14:49 ha-node2 attrd[2281]: notice: Removing ha-node3/3 from the membership list
Jul 31 12:14:49 ha-node2 attrd[2281]: notice: Purged 1 peers with id=3 and/or uname=ha-node3 from the membership cache
Jul 31 12:14:49 ha-node2 xinetd[1175]: START: mysqlchk pid=66355 from=::ffff:192.168.8.102
Jul 31 12:14:49 ha-node2 xinetd[1175]: EXIT: mysqlchk status=1 pid=66340 duration=0(sec)
Jul 31 12:14:49 ha-node2 xinetd[1175]: EXIT: mysqlchk status=1 pid=66341 duration=0(sec)
Jul 31 12:14:49 ha-node2 xinetd[1175]: EXIT: mysqlchk signal=13 pid=66355 duration=0(sec)
Jul 31 12:14:49 ha-node2 corosync[1444]: [TOTEM ] A new membership (192.168.8.102:11184) was formed. Members
Jul 31 12:14:49 ha-node2 corosync[1444]: [QUORUM] Members[1]: 2
Jul 31 12:14:49 ha-node2 corosync[1444]: [MAIN ] Completed service synchronization, ready to provide service.
Jul 31 12:14:49 ha-node2 crmd[2285]: notice: State transition S_ELECTION -> S_INTEGRATION [ input=I_ELECTION_DC cause=C_TIMER_POPPED origin=election_timeout_popped ]
Jul 31 12:14:49 ha-node2 crmd[2285]: warning: FSA: Input I_ELECTION_DC from do_election_check() received in state S_INTEGRATION
Jul 31 12:14:49 ha-node2 crmd[2285]: notice: Notifications disabled
Jul 31 12:14:49 ha-node2 corosync[1444]: [TOTEM ] A new membership (192.168.8.101:11188) was formed. Members joined: 1 3
Jul 31 12:14:49 ha-node2 pacemakerd[1675]: error: Node ha-node1[1] appears to be online even though we think it is dead
Jul 31 12:14:49 ha-node2 pacemakerd[1675]: notice: pcmk_cpg_membership: Node ha-node1[1] - state is now member (was lost)
Jul 31 12:14:49 ha-node2 pacemakerd[1675]: error: Node ha-node3[3] appears to be online even though we think it is dead
Jul 31 12:14:49 ha-node2 pacemakerd[1675]: notice: pcmk_cpg_membership: Node ha-node3[3] - state is now member (was lost)
Jul 31 12:14:49 ha-node2 attrd[2281]: notice: crm_update_peer_proc: Node ha-node1[1] - state is now member (was (null))
Jul 31 12:14:49 ha-node2 cib[2277]: notice: crm_update_peer_proc: Node ha-node1[1] - state is now member (was (null))
Jul 31 12:14:49 ha-node2 corosync[1444]: [QUORUM] This node is within the primary component and will provide service.
Jul 31 12:14:49 ha-node2 corosync[1444]: [QUORUM] Members[3]: 1 2 3
Jul 31 12:14:49 ha-node2 corosync[1444]: [MAIN ] Completed service synchronization, ready to provide service.
Jul 31 12:14:49 ha-node2 pacemakerd[1675]: notice: Membership 11188: quorum acquired (3)
Jul 31 12:14:49 ha-node2 stonith-ng[2279]: notice: crm_update_peer_proc: Node ha-node1[1] - state is now member (was (null))
Jul 31 12:14:49 ha-node2 cib[2277]: notice: crm_update_peer_proc: Node ha-node3[3] - state is now member (was (null))
Jul 31 12:14:49 ha-node2 attrd[2281]: notice: crm_update_peer_proc: Node ha-node3[3] - state is now member (was (null))
Jul 31 12:14:49 ha-node2 stonith-ng[2279]: notice: crm_update_peer_proc: Node ha-node3[3] - state is now member (was (null))
Jul 31 12:14:49 ha-node2 crmd[2285]: notice: Membership 11188: quorum acquired (3)
Jul 31 12:14:49 ha-node2 crmd[2285]: notice: pcmk_quorum_notification: Node ha-node1[1] - state is now member (was lost)
Jul 31 12:14:49 ha-node2 crmd[2285]: notice: pcmk_quorum_notification: Node ha-node3[3] - state is now member (was lost)
Jul 31 12:14:49 ha-node2 attrd[2281]: notice: Recorded attribute writer: ha-node3
Jul 31 12:14:49 ha-node2 attrd[2281]: notice: Processing sync-response from ha-node3
EDIT-1
I use clustercheck to check the status of cluster in the ha-node2, I found the connection is close, and the galera cluster node is not synced:
[root#ha-node2 ~]# clustercheck
HTTP/1.1 503 Service Unavailable
Content-Type: text/plain
Connection: close
Content-Length: 36
Galera cluster node is not synced.
And in the ha-node1 and ha-node3 is connection is close, and galera cluster node is synced:
[root#ha-node1 ~]# clustercheck
HTTP/1.1 200 OK
Content-Type: text/plain
Connection: close
Content-Length: 32
Galera cluster node is synced.

I personally see issue in message xinetd[1175]: EXIT: mysqlchk signal=13. From the xinetd man pages it is
For services with type =
INTERNAL, SIGTERM signal will be sent. For services without type =
INTERNAL, SIGKILL signall will be sent.
In your case it is SIGPIPE 13 Write on a pipe with no reader, Broken pipe (POSIX)
The most likely cause is:
Jul 31 12:14:49 ha-node2 attrd[2281]: notice: Lost attribute writer ha-node3 You have to trace this one to find out what is happening between ha-node2 and ha-node3 (I recommend tcpdump for that)
.
I would have to see more of your mysqlchk or the script that makes your HAproxy.
If nothing will help you can also try alternative HAClustering solution https://github.com/olafz/percona-clustercheck

Related

MySQL Workbench error: Lost connection to MySQL server; Terminal error: Error: 13 (Permission denied)

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

Error establishing a database connection - AWS Linux 2

Using AWS Linux 2, on my wp site this error "Error establishing a database connection", I believe I was hacked via the wp blog page and the entire site is disabled. Using MySQL:
$ 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.
At first didn't realize that I needed to run those two commands in the CLI. Here is the output for systemctl status mysqld.service -l:
$ systemctl status mysqld.service -l
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sun 2022-02-13 21:00:30 UTC; 6h ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 19959 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS (code=exited, status=1/FAILURE)
Process: 19926 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 19959 (code=exited, status=1/FAILURE)
Status: "Server startup in progress"
Error: 13 (Permission denied)
Feb 13 21:00:30 ip-172-31-91-154.ec2.internal mysqld[19959]: 2022-02-13T21:00:30.730728Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.28) starting as process 19959
Feb 13 21:00:30 ip-172-31-91-154.ec2.internal mysqld[19959]: 2022-02-13T21:00:30.734108Z 0 [Warning] [MY-010091] [Server] Can't create test file /var/lib/mysql/mysqld_tmp_file_case_insensitive_test.lower-test
Feb 13 21:00:30 ip-172-31-91-154.ec2.internal mysqld[19959]: 2022-02-13T21:00:30.734121Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
Feb 13 21:00:30 ip-172-31-91-154.ec2.internal mysqld[19959]: 2022-02-13T21:00:30.734720Z 0 [ERROR] [MY-010187] [Server] Could not open file '/var/log/mysqld.log' for error logging: Permission denied
Feb 13 21:00:30 ip-172-31-91-154.ec2.internal mysqld[19959]: 2022-02-13T21:00:30.736749Z 0 [ERROR] [MY-010119] [Server] Aborting
Feb 13 21:00:30 ip-172-31-91-154.ec2.internal mysqld[19959]: 2022-02-13T21:00:30.736912Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.28) MySQL Community Server - GPL.
Feb 13 21:00:30 ip-172-31-91-154.ec2.internal systemd[1]: mysqld.service: main process exited, code=exited, status=1/FAILURE
Feb 13 21:00:30 ip-172-31-91-154.ec2.internal systemd[1]: Failed to start MySQL Server.
Feb 13 21:00:30 ip-172-31-91-154.ec2.internal systemd[1]: Unit mysqld.service entered failed state.
Feb 13 21:00:30 ip-172-31-91-154.ec2.internal systemd[1]: mysqld.service failed.
and running journalctl -xe -l:
Feb 14 03:17:27 ip-172-31-91-154.ec2.internal sshd[29726]: Excess permission or bad ownership on file /var/lo
Feb 14 03:17:27 ip-172-31-91-154.ec2.internal sshd[29726]: Received disconnect from 81.70.242.147 port 43604:
Feb 14 03:17:27 ip-172-31-91-154.ec2.internal sshd[29726]: Disconnected from 81.70.242.147 port 43604 [preaut
Feb 14 03:17:41 ip-172-31-91-154.ec2.internal sshd[29728]: Connection closed by 104.243.26.5 port 46890 [prea
Feb 14 03:18:06 ip-172-31-91-154.ec2.internal sshd[29730]: Invalid user yw from 82.196.5.221 port 47008
Feb 14 03:18:06 ip-172-31-91-154.ec2.internal sshd[29730]: Excess permission or bad ownership on file /var/lo
Feb 14 03:18:06 ip-172-31-91-154.ec2.internal sshd[29730]: input_userauth_request: invalid user yw [preauth]
Feb 14 03:18:06 ip-172-31-91-154.ec2.internal sshd[29730]: pam_unix(sshd:auth): check pass; user unknown
Feb 14 03:18:06 ip-172-31-91-154.ec2.internal sshd[29730]: pam_unix(sshd:auth): authentication failure; logna
Feb 14 03:18:08 ip-172-31-91-154.ec2.internal sshd[29730]: Failed password for invalid user yw from 82.196.5.
Feb 14 03:18:08 ip-172-31-91-154.ec2.internal sshd[29730]: Excess permission or bad ownership on file /var/lo
Feb 14 03:18:08 ip-172-31-91-154.ec2.internal sshd[29730]: Received disconnect from 82.196.5.221 port 47008:1
Feb 14 03:18:08 ip-172-31-91-154.ec2.internal sshd[29730]: Disconnected from 82.196.5.221 port 47008 [preauth
Feb 14 03:18:15 ip-172-31-91-154.ec2.internal sshd[29732]: Invalid user server from 120.53.121.152 port 59070
Feb 14 03:18:15 ip-172-31-91-154.ec2.internal sshd[29732]: Excess permission or bad ownership on file /var/lo
Feb 14 03:18:15 ip-172-31-91-154.ec2.internal sshd[29732]: input_userauth_request: invalid user server [preau
Feb 14 03:18:15 ip-172-31-91-154.ec2.internal sshd[29732]: pam_unix(sshd:auth): check pass; user unknown
Feb 14 03:18:15 ip-172-31-91-154.ec2.internal sshd[29732]: pam_unix(sshd:auth): authentication failure; logna
Feb 14 03:18:18 ip-172-31-91-154.ec2.internal sshd[29732]: Failed password for invalid user server from 120.5
Feb 14 03:18:18 ip-172-31-91-154.ec2.internal sshd[29732]: Excess permission or bad ownership on file /var/lo
Feb 14 03:18:19 ip-172-31-91-154.ec2.internal sshd[29732]: Received disconnect from 120.53.121.152 port 59070
Feb 14 03:18:19 ip-172-31-91-154.ec2.internal sshd[29732]: Disconnected from 120.53.121.152 port 59070 [preau
Feb 14 03:18:27 ip-172-31-91-154.ec2.internal dhclient[2827]: XMT: Solicit on eth0, interval 111530ms.
I tried removing the db and reinstalling but this did not make any difference.
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:
access forbidden by rule
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
Deleting the ec2 instance and starting over was the direction I took. Still no idea of what caused the error however am double checking security holes and patching up. Thanks everyone for responding.
best

mysql - failed unable to start

I don't know why this error
Error message:
root#li1714-176:/data/mysql# systemctl status mysqld.service
● mysqld.service - LSB: start and stop MySQL
Loaded: loaded (/etc/init.d/mysqld; generated)
Active: failed (Result: exit-code) since Wed 2020-03-25 08:47:34 CST; 23min ago
Docs: man:systemd-sysv-generator(8)
Process: 3776 ExecStart=/etc/init.d/mysqld start (code=exited, status=1/FAILURE)
Mar 25 08:47:32 li1714-176 systemd[1]: Starting LSB: start and stop MySQL...
Mar 25 08:47:32 li1714-176 mysqld[3776]: Starting MySQL
Mar 25 08:47:34 li1714-176 mysqld[3776]: .. * The server quit without updating PID file (/data/mysql/mysql.pid).
Mar 25 08:47:34 li1714-176 systemd[1]: mysqld.service: Control process exited, code=exited status=1
Mar 25 08:47:34 li1714-176 systemd[1]: mysqld.service: Failed with result 'exit-code'.
Mar 25 08:47:34 li1714-176 systemd[1]: Failed to start LSB: start and stop MySQL.
Mar 25 09:31:52 li1714-176 rsyslogd[588]: file '7' write error: No space left on device [v8.32.0 try http://www.rsyslog.com/e/2027 ]
Mar 25 09:31:52 li1714-176 rsyslogd[588]: action 'action 2' (module 'builtin:omfile') message lost, could not be processed. Check for additional error messa
Mar 25 09:31:52 li1714-176 rsyslogd[588]: file '7' write error: No space left on device [v8.32.0 try http://www.rsyslog.com/e/2027 ]
Mar 25 09:31:54 li1714-176 sshd[8551]: Failed password for invalid user mk from 170.231.57.142 port 6220 ssh2
Mar 25 09:31:54 li1714-176 sshd[8551]: Received disconnect from 170.231.57.142 port 6220:11: Bye Bye [preauth]
Mar 25 09:31:54 li1714-176 sshd[8551]: Disconnected from invalid user mk 170.231.57.142 port 6220 [preauth]
journalctl -u mysqld.service error:
Mar 25 06:40:19 li1714-176 systemd[1]: Starting LSB: start and stop MySQL...
Mar 25 06:40:19 li1714-176 mysqld[751]: Starting MySQL
Mar 25 06:40:21 li1714-176 mysqld[751]: .. * The server quit without updating PID file (/data/mysql/mysql.pid).
Mar 25 06:40:21 li1714-176 systemd[1]: mysqld.service: Control process exited, code=exited status=1
Mar 25 06:40:21 li1714-176 systemd[1]: mysqld.service: Failed with result 'exit-code'.
Mar 25 06:40:21 li1714-176 systemd[1]: Failed to start LSB: start and stop MySQL.
Mar 25 08:47:32 li1714-176 systemd[1]: Starting LSB: start and stop MySQL...
Mar 25 08:47:32 li1714-176 mysqld[3776]: Starting MySQL
Mar 25 08:47:34 li1714-176 mysqld[3776]: .. * The server quit without updating PID file (/data/mysql/mysql.pid).
Mar 25 08:47:34 li1714-176 systemd[1]: mysqld.service: Control process exited, code=exited status=1
Mar 25 08:47:34 li1714-176 systemd[1]: mysqld.service: Failed with result 'exit-code'.
Mar 25 08:47:34 li1714-176 systemd[1]: Failed to start LSB: start and stop MySQL.
Mar 25 09:31:40 li1714-176 systemd[1]: Starting LSB: start and stop MySQL...
Mar 25 09:31:40 li1714-176 mysqld[7625]: Starting MySQL
Mar 25 09:31:42 li1714-176 mysqld[7625]: .. * The server quit without updating PID file (/data/mysql/mysql.pid).
How to free up more space.
I want to start or extract the database normally
Given rsyslog is complaining about 'No space left on device' I suspect that mysql will have the same problem. It needs space to work as well.
journalctl -u mysqld.service
to see mysql errors, though it is probably also having limited recording due to out of space.
Fix the amount of free space on your storage and make all your programs happy.

I tried to reinstall MySQL on centos and now it doesn't start

I tried to reinstall MySQL and now it doesn't even start, and if I go to "messages" it says this
Jul 23 11:04:27 systemd: Starting MySQL Server...
Jul 23 11:04:29 systemd: mysqld.service: main process exited, code=exited, status=1/FAILURE
Jul 23 11:04:29 systemd: Failed to start MySQL Server.
Jul 23 11:04:29 systemd: Unit mysqld.service entered failed state.
Jul 23 11:04:29 systemd: mysqld.service failed.

Why MariaDB won't start on Fedora 20?

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.