Resolved MariaDB fails to start

Asked 1 years ago, Updated 1 years ago, 36 views

I installed MariaDB on CentOS 7.1.1503 and tried systemctl start mysql, but I couldn't start it.

I used this site as a reference to work.
http://love-zawa.hatenablog.com/entry/2014/07/24/CentOS_6_5%E3%81%ABMariaDB_10_0_12%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB (yum%E3%82%92%E4%BD%BF%E7%94%A8)

#vim/etc/yum.repos.d/mariadb.repo
[Mariadb]
name = MariaDB
baseurl=http://yum.mariadb.org/10.0.20/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
enabled = 1

If this is OK, the installation is complete.If you get "Transaction Check Error:", you should delete mysql-libs.

I deleted mysql-libs because I got Transaction Check Error: on the way.

systemctl start mysql results are

#systemctl start mysql
Job for mysql.service failed.See'systemctl status mysql.service' and 'journalctl-xn' for details.

The results of systemctl status mysql and journalctl-xn are

#systemctl status mysql
mysql.service-LSB:start and stop MySQL
   Loaded: loaded (/etc/rc.d/init.d/mysql)
   Active: failed (Result: exit-code) since water 2015-07-01 12:12:03 JST; 6minago
  Process: 6341 ExecStart=/etc/rc.d/init.d/mysql start (code=exited, status=1/FAILURE)

 July 01 12:12:02 localhost.localdomain systemd[1]:Starting LSB:start and stop MySQL...
 July 01 12:12:03 localhost.localdomain mysql [6341]: Starting MySQL.ERROR!
 July 01 12:12:03 localhost.localdomain systemd[1]:mysql.service:control process expired, code=exited status=1
 July 01 12:12:03 localhost.localdomain systemd[1]: Failed to start LSB: start and stop MySQL.
 July 01 12:12:03 localhost.localdomain systemd[1]: Unit mysql.service entered failed state.


# journalctl-xn
-- Logs begin at water 2015-07-01 01:58:42 JST, end at water 2015-07-01 12:20:01 JST. --
 July 01 12:17:12 localhost.localdomain avahi-daemon [597]: Withdrawing address record for fe80::a 00:27ff:fe51:68d4
 July 01 12:19:29 localhost.localdomain systemd[1]:Starting LSB:start and stop MySQL...
-- Subject: Unit mysql.service has been with start-up
-- Defined-By:systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mysql.service has been starting up.
 July 01 12:19:30 localhost.localdomain mysql [6869]: Starting MySQL.ERROR!
 July 01 12:19:30 localhost.localdomain systemd[1]:mysql.service:control process expired, code=exited status=1
 July 01 12:19:30 localhost.localdomain systemd[1]: Failed to start LSB: start and stop MySQL.
-- Subject: Unit mysql.service has failed
-- Defined-By:systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mysql.service has failed.
-- 
-- The result is failed.
 July 01 12:19:30 localhost.localdomain systemd[1]: Unit mysql.service entered failed state.
-- Logs begin at water 2015-07-01 01:58:42 JST, end at water 2015-07-01 12:20:01 JST. --
 July 01 12:17:12 localhost.localdomain avahi-daemon [597]: Withdrawing address record for fe80::a 00:27ff:fe51:68d4
 July 01 12:19:29 localhost.localdomain systemd[1]:Starting LSB:start and stop MySQL...
-- Subject: Unit mysql.service has been with start-up
-- Defined-By:systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mysql.service has been starting up.
 July 01 12:19:30 localhost.localdomain mysql [6869]: Starting MySQL.ERROR!
 July 01 12:19:30 localhost.localdomain systemd[1]:mysql.service:control process expired, code=exited status=1
 July 01 12:19:30 localhost.localdomain systemd[1]: Failed to start LSB: start and stop MySQL.
-- Subject: Unit mysql.service has failed
-- Defined-By:systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mysql.service has failed.
-- 
-- The result is failed.
 July 01 12:19:30 localhost.localdomain systemd[1]: Unit mysql.service entered failed state.
 July 01 12:20:01 localhost.localdomain systemd[1]: Created slice user-0.slice.
-- Subject: Unit user-0.slice has finished start-up
-- Defined-By:systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit user-0.slice has finished starting up.
-- 
-- The start-up result is done.
 July 01 12:20:01 localhost.localdomain systemd[1]: Starting Session 10 of user root.
-- Subject: Unit session-10.scope has been with start-up
-- Defined-By:systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit session-10. scope has been started up.
 July 01 12:20:01 localhost.localdomain systemd[1]: Started Session 10 of user root.
-- Subject: Unit session-10.scope has finished start-up
-- Defined-By:systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit session-10. scope has finished starting up.
-- 
-- The start-up result is done.
 July 01 12:20:01 localhost.localdomain CROND [6983]: (root) CMD (/usr/lib64/sa/sa111)

Yes, I'm struggling because I don't have much information.

#mysqladmin ping
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket'/var/lib/mysql/mysql.sock'(2 "No such file or directory")'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!

The /var/lib/mysql/hostname.err file may contain some reason for the error.

Also, mysql-libs is not present in CentOS 7.1.Is it mariadb-libs (5.5.41)?
Is it from another repository such as mysql.com?
CentOS 7.1 mariadb-libs will replace MariaDB-shared when it is installed, so you don't need to uninstall it manually.

#catlocalhost.localdomain.err
15070309:46:47 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
150703 9:46:47 [Note]/usr/sbin/mysqld(mysqld10.0.20-MariaDB) starting as process8775...
150703 9:46:47 [Note] InnoDB: Using mutexes to ref count buffer pool pages
150703 9:46:47 [Note] InnoDB: The InnoDB memory heap is disabled
150703 9:46:47 [Note]InnoDB:Mutexes and rw_locks use GCC atomic buildingtins
150703 9:46:47 [Note] InnoDB: Memory barrier is not used
150703 9:46:47 [Note] InnoDB: Compressed tables use zlib 1.2.7
150703 9:46:47 [Note]InnoDB:Using Linux native AIO
150703 9:46:47 [Note]InnoDB:Not using CPU crc32 instructions
150703 9:46:47 [Note] InnoDB: Initializing buffer pool, size = 128.0M
150703 9:46:47 [Note] InnoDB: Completed initialization of buffer pool
150703 9:46:47 [ERROR]InnoDB:./ibdata1 can't be opened in read-write mode
150703 9:46:47 [ERROR] InnoDB: The system tablespace must be writable!
150703 9:46:47 [ERROR] Plugin'InnoDB' init function returned error.
150703 9:46:47 [ERROR] Plugin'InnoDB' registration as a STORAGE ENGINE failed.
150703 9:46:47 [ERROR] mysqld:File'/var/lib/mysql/aria_log_control'not found (Errcode:13 "Permission denied")
150703 9:46:47 [ERROR] mysqld: Got error 'Can't open file' when trying to use area control file'/var/lib/mysql/aria_log_control'
150703 9:46:47 [ERROR] Plugin 'Aria' init function returned error.
150703 9:46:47 [ERROR] Plugin'Aria' registration as a STORAGE ENGINE failed.
150703 9:46:47 [Note] Plugin'FEEDBACK' is disabled.
150703 9:46:47 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
150703 9:46:47 [ERROR] Unknown/unsupported storage engine:InnoDB
150703 9:46:47 [ERROR] Aborting

150703 9:46:47 [Note]/usr/sbin/mysqld: Shutdown complete

15070309:46:47 mysqld_safe mysqld from pid file/var/lib/mysql/localhost.localdomain.pid ending

./ibdata1 cannot be written, so I changed the owner/ownership group.

#cd/var/lib/mysql
# ls-l
Total 110644
-rw-rw ----.1 root root 16384 July 11:44 aria_log.00000001
-rw-rw ----.1 root root 52 July 11:44 aria_log_control
-rw-rw ----.1 root root 50331648 July 11:44 ib_logfile0
-rw-rw ----.1 root root 50331648 July 11:44 ib_logfile1
-rw-rw ----.1 root root 12582912 July 11:44 ibdata1
-rw-r-----1 mysql root 22584 July 309:46 localhost.localdomain.err
drwx ------.2 root root 4096 July 11:44 mysql
drwx --------.2 root root 4096 July 11:44 performance_schema
drwx ------.2 root root 6 July 11:44 test

# cd../
# chown mysql —mysql mysql-R

Now I ran systemctl start mysql and it worked!

#systemctl start mysql
# systemctl status mysql
mysql.service-LSB:start and stop MySQL
   Loaded: loaded (/etc/rc.d/init.d/mysql)
   Active: active (running) since Friday 2015-07-0309:50:42 JST; 12sago
  Process:20024ExecStart=/etc/rc.d/init.d/mysql start (code=exited, status=0/SUCCESS)
   CGgroup: /system.slice/mysql.service
           --20029/bin/sh/usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/...
           --20102/usr/sbin/mysqld --basedir=/usr --dataadir=/var/lib/mysql --plugin-...

 July 0309:50:40 localhost.localdomain systemd[1]:Starting LSB:start and stop MyS....
 July 0309:50:42 localhost.localdomain mysql [20024]: Starting MySQL.SUCCESS!
 July 0309:50:42 localhost.localdomain systemd[1]:Started LSB:start and stop MySQL.
Hint: Some lines were well-known, use-l to show in full.

mysql.sock was created after mariaDB started

#ls-l
Total 110648
-rw-rw ----.1 mysql mysql 16384 July 11:44 aria_log.00000001
-rw-rw ----.1 mysql mysql 52 July 11:44 aria_log_control
-rw-rw ----.1 mysql mysql 50331648 July 309:50 ib_logfile0
-rw-rw ----.1 mysql mysql 50331648 July 11:44 ib_logfile1
-rw-rw ----.1 mysql mysql 12582912 July 309:50 ibdata1
-rw-r-----1 mysql mysql 24010 July 309:50 localhost.localdomain.err
-rw-rw ----.1 mysql mysql July 309:50 localhost.localdomain.pid
-rw-rw ----.1 mysql mysql 0 July 309:50 multi-master.info
drwx --------.2 mysql mysql 4096 July 11:44 mysql
srwxrwxrwx.1 mysql mysql 0 July 309:50 mysql.sock
drwx --------.2 mysql mysql 4096 July 11:44 performance_schema
drwx ------.2 mysql mysql 6 July 11:44 test

Verifying Startup

#mysql
Welcome to the MariaDB monitor.Commands end with;or\g.
Your MariaDB connection id is 3
Server version: 10.0.20 - MariaDB MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Aband others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

Mysql-libs is from mysql.com.
To briefly explain what I did before installing mariaDB, I installed MySQL before.However, there was a error in the boot: 'Can't connect to local MySQL server through socket'/var/lib/mysql/mysql.sock'(2"No such file or directory")' and I left it unresolved.So I decided to move to mariaDB.By the way, this CentOS 7.1 is powered by VirtualBox.

mysql centos

2022-09-29 22:25

2 Answers

Unfortunately, I don't have the actual file at hand, so I can't identify it here

According to the systemctl status mysql output, when ExecStart /etc/rc.d/init.d/mysql, the process id is 6341, and the process 6341 is

July 01 12:12:03 localhost.localdomain mysql [6341]: Starting MySQL.ERROR!

But it stopped, so you can find out the reason if you find the error message in /etc/rc.d/init.d/mysql.


2022-09-29 22:25

The /var/lib/mysql/hostname.err file may contain some reason for the error.

Also, mysql-libs is not present in CentOS 7.1.Is it mariadb-libs (5.5.41)?
Is it from another repository such as mysql.com?
CentOS 7.1 mariadb-libs will replace MariaDB-shared when it is installed, so you don't need to uninstall it manually.

Just in case, you should check if RPM is installed correctly and if there is any corruption in the file.

#rpm-qa "MariaDB*"
MariaDB-shared-10.0.20-1.el7.centos.x86_64
MariaDB-common-10.0.20-1.el7.centos.x86_64
MariaDB-server-10.0.20-1.el7.centos.x86_64
MariaDB-client-10.0.20-1.el7.centos.x86_64

# rpm - Va "MariaDB*"
  (Only the modified configuration file does not output.) 


2022-09-29 22:25

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.