2
votes

I am trying to start mariadb with systemctl start mariadb also tried using sudo along.

This is what it says

Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.

I saw this at many places but nothing helped.

It fails, I removed, installed again, nothing happened.

This is a part of /var/log/messages

Jun 17 18:03:09 controller systemd: Starting MariaDB 10.1 database
server... 
Jun 17 18:03:09 controller mysqld: 2016-06-17 18:03:09 140477178509440
       [Note] /usr/libexec/mysqld (mysqld 10.1.12-MariaDB) starting as process 120408 ... 
Jun 17 18:03:12 controller systemd: mariadb.service: main process exited, code=exited, status=1/FAILURE 
Jun 17 18:04:13 controller systemd: mariadb.service: control process exited, code=exited status=3 
Jun 17 18:04:13 controller systemd: Failed to start MariaDB 10.1 database server. 
Jun 17 18:04:13 controller systemd: Unit mariadb.service entered failed state. 
Jun 17 18:04:13 controller systemd: mariadb.service failed.

I am really new to CentOS and mariadb, so I don't know how to proceed.

EDIT

The mariadb.log says

2016-06-17 19:24:39 140652810123392 [Note] Server socket created on IP: '::'.
2016-06-17 19:24:39 140652810123392 [ERROR] Can't start server: Bind on TCP/IP port. Got error: 98: Address already in use
2016-06-17 19:24:39 140652810123392 [ERROR] Do you already have another mysqld server running on port: 3306 ? 2016-06-17 19:24:39 140652810123392 [ERROR] Aborting

This is my my.cnf

#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]

#
# This group is read by the server
#
[mysqld]
port=5555
bind-address = 10.23.77.68
default-storage-engine = innodb
innodb_file_per_table
collation-server = utf8_general_ci
init-connect = 'SET NAMES utf8'
character-set-server = utf8

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

#
# include all files from the config directory
#
!includedir /etc/my.cnf.d

I tried adding a line in my.cnf

port=5555

Didn't help, mariadb.log says the same thing as I have mentioned earlier.

2
Do you have mariaDB logs /var/log/mysql/* you should see some error log there, see if there is more data than what you see in messages. What port are you running db on? Is it being blocked by another program? - irimawi
I have /var/log/mysqld.log Please enter more information as in the exact commands or place to look into. I am really new to all this and Linux. - Bhavya Arora
I also have /var/log/mariadb/mariadb.log - Bhavya Arora
any errors that make sense in either file? if you type ps aux | grep -i mysql do you see it running? If so, what happens if you stop mysql and start mariadb? - irimawi
The mariadb.log says 2016-06-17 19:24:39 140652810123392 [Note] Server socket created on IP: '::'. 2016-06-17 19:24:39 140652810123392 [ERROR] Can't start server: Bind on TCP/IP port. Got error: 98: Address already in use 2016-06-17 19:24:39 140652810123392 [ERROR] Do you already have another mysqld server running on port: 3306 ? 2016-06-17 19:24:39 140652810123392 [ERROR] Aborting - Bhavya Arora

2 Answers

4
votes

I solved as follows:

  1. After installing

  2. Run: > mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/

  3. Then: >mysql_secure_installation

  4. And then: systemctl start mariadb

With this this, I can resolved.

0
votes

fuser -k 3306/tcp will solve the probem. -k is to Kill processes accessing the file.