0

I had installed MySQL using docker some time back it worked until before this error, My laptop switched off due, I rebooted my VM (on Fedora 27) for some reason, I am facing below error, while I was trying to start mysql service. Also I tried to start sudo service docker restart I get same error. So I am unable to start either docker or mysql server, finally I removed docker installed packages sudo dnf remove docker-ce, then installed MySQL 5.7 community server referring to MySQL 5.7 installation guide

I do not know whether my Linux OS level anything corrupted???

[ravibeli@localdomain ~]$ sudo service mysqld start

Logs:
[sudo] password for ravibeli: 
Starting mysqld (via systemctl):  Job for mysqld.service failed because the control process exited with error code.
See "systemctl  status mysqld.service" and "journalctl  -xe" for details.
                                                           [FAILED]

When I run 'journalctl -xe' below error message shown, and unable to fix it? what is the way to fix this issue on VM (Fedora 27)

[ravibeli@localdomain ~]$ journalctl -xe

May 07 16:06:53 localdomain sudo[6971]: pam_unix(sudo:session): session opened for user root by (uid=0)
May 07 16:06:53 localdomain audit[6971]: USER_START pid=6971 uid=0 auid=1000 ses=2 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:sess
May 07 16:06:53 localdomain systemd[1]: Starting SYSV: MySQL database server....
-- Subject: Unit mysqld.service has begun start-up
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mysqld.service has begun starting up.
May 07 16:06:53 localdomain mysqld[8145]: chown: invalid user: ‘mysql:mysql’
May 07 16:06:54 localdomain audit[726]: USER_AVC pid=726 uid=81 auid=4294967295 ses=4294967295 subj=system_u:system_r:system_dbusd_t:s0-s0:c0.c1023 msg='avc: 
                                         exe="/usr/bin/dbus-daemon" sauid=81 hostname=? addr=? terminal=?'
May 07 16:06:54 localdomain mysqld[8145]: Initializing MySQL database:  2018-05-07T10:36:54.847676Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is depre
May 07 16:06:54 localdomain mysqld[8145]: 2018-05-07T10:36:54.851156Z 0 [ERROR] Fatal error: Can't change to run as user 'mysql' ;  Please check that the user
May 07 16:06:54 localdomain mysqld[8145]: 2018-05-07T10:36:54.851678Z 0 [ERROR] Aborting
May 07 16:06:54 localdomain mysqld[8145]: [FAILED]
May 07 16:06:54 localdomain systemd[1]: mysqld.service: Control process exited, code=exited status=1
May 07 16:06:54 localdomain systemd[1]: Failed to start SYSV: MySQL database server..
-- Subject: Unit mysqld.service has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mysqld.service has failed.
-- 
-- The result is failed.
May 07 16:06:54 localdomain systemd[1]: mysqld.service: Unit entered failed state.
May 07 16:06:54 localdomain systemd[1]: mysqld.service: Failed with result 'exit-code'.
May 07 16:06:54 localdomain audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=mysqld comm="systemd
May 07 16:06:54 localdomain sudo[6971]: pam_unix(sudo:session): session closed for user root
May 07 16:06:54 localdomain audit[6971]: USER_END pid=6971 uid=0 auid=1000 ses=2 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:sessio
May 07 16:06:54 localdomain audit[6971]: CRED_DISP pid=6971 uid=0 auid=1000 ses=2 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:setcr
lines 1393-1422/1422
0

The journal log indicates that the user mysql might not exist. I can see from the above that you are logged in as user ravibeli.

Fatal error: Can't change to run as user 'mysql' ;  Please check that the user

To check if the user mysql exists run the following, it should return a valid user id, if it doesn't then the user doesn't exist and you need to sort that out - most likely a mysqld or Docker configuration problem:

id -u mysql

If the user does exist, try using systemctl to start the service:

systemctl start mysqld.service

The mysqld service has a log file located at /var/log/mysqld.log, if none of the above works, this log file may contain more detail about the issue - please add this to your question and we may be able to help you further.

Seeing as you say the user and group do exist, check which user owns the /var/lib/mysql folder by running the following command:

ls -l /var/lib/mysql

If the mysql user does not own the file, then change the ownership using the following command:

chown mysql:mysql -R /var/lib/mysql
  • user and group as mysql exists and /var/log/mysqld.log this file has nothing any log, nothing is writing in it. – ravibeli May 8 '18 at 9:20
  • I've added a comment to my answer which may help in that case. – YodaScholtz May 8 '18 at 9:28
  • "chown: invalid user: ‘mysql:mysql" makes me think it is an ownership issue, if the user and group does exist. – YodaScholtz May 8 '18 at 9:33
  • You are Mr. Perfect. Running these commands as you suggested chown mysql:mysql -R /var/lib/mysql then running systemctl start mysqld.service post resolving broker packages using dnf clean all then dnf update then re-installed MySQL 5.7 server using dnf install mysql-community-server resolved the problem – ravibeli May 8 '18 at 9:34
  • Great! Glad it helped. If this or any answer has solved your question please consider accepting it by clicking the check-mark. This indicates to the wider community that you've found a solution and gives some reputation to both the answerer and yourself. There is no obligation to do this. – YodaScholtz May 8 '18 at 9:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.