MySQL Forums
Forum List  »  Install & Repo

Re: unable to start mysqld.service but command line works
Posted by: James Preston
Date: October 08, 2024 10:40AM

Operating system is Fedora 40, currently up to date.
Install is from Fedora repo

These are my current errors from trying to start mysqld.service:

This is the output of systemctl status mysqld.service:

systemctl status mysqld.service
× mysqld.service - MySQL Server Documentation=man:mysqld(8)
Loaded: loaded (/etc/systemd/system/mysqld.service; enabled; preset: disabled)
Drop-In: /usr/lib/systemd/system/service.d
└─10-timeout-abort.conf
Active: failed (Result: exit-code) since Tue 2024-10-08 08:47:06 MST; 28s ago
Docs: http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 104965 ExecStart=mysqld --defaults-file=/etc/my.cnf -D (code=exited, status=1/FAILURE)
Main PID: 104965 (code=exited, status=1/FAILURE)
Status: "Server shutdown complete (with return value = 1)"
Error: 22 (Invalid argument)
CPU: 1.411s

Oct 08 08:45:24 systemd[1]: Starting mysqld.service - MySQL Server Documentation=man:mysqld(8)...
Oct 08 08:47:06 mysqld[104965]: 2024-10-08T15:47:06.126830Z 0 [ERROR] [MY-010946] [Server] Failed to start mysqld daemon. Check mysqld error log.
Oct 08 08:47:06 systemd[1]: mysqld.service: Main process exited, code=exited, status=1/FAILURE
Oct 08 08:47:06 systemd[1]: mysqld.service: Failed with result 'exit-code'.
Oct 08 08:47:06 systemd[1]: Failed to start mysqld.service - MySQL Server Documentation=man:mysqld(8).
Oct 08 08:47:06 systemd[1]: mysqld.service: Consumed 1.411s CPU time.

This is from my localhost.err file:

2024-10-08T03:45:04.696002Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2024-10-08T03:45:05.526495Z 0 [Warning] [MY-010091] [Server] Can't create test file /tmp/data/mysqld_tmp_file_case_insensitive_test.lower-test
2024-10-08T03:45:05.526815Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.2) starting as process 86935
2024-10-08T03:45:05.539269Z 0 [Warning] [MY-010091] [Server] Can't create test file /tmp/data/mysqld_tmp_file_case_insensitive_test.lower-test
2024-10-08T03:45:05.539298Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /tmp/data/ is case insensitive
2024-10-08T03:45:05.581380Z 0 [Warning] [MY-010075] [Server] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: b4d45f21-8527-11ef-a316-001aa018c874.
mysqld: File '/tmp/data/auto.cnf' not found (OS errno 13 - Permission denied)
2024-10-08T03:45:05.581682Z 0 [ERROR] [MY-010183] [Server] Failed to create file(file: '/tmp/data/auto.cnf', errno 13)
2024-10-08T03:45:05.581714Z 0 [ERROR] [MY-010076] [Server] Initialization of the server's UUID failed because it could not be read from the auto.cnf file. If this is a new server, the initialization failed because it was not possible to generate a new UUID.
2024-10-08T03:45:05.581932Z 0 [ERROR] [MY-010119] [Server] Aborting
2024-10-08T03:45:05.624342Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.2) MySQL Community Server - GPL.
2024-10-08T03:45:05.624486Z 0 [System] [MY-015016] [Server] MySQL Server - end.
2024-10-08T15:45:24.324380Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2024-10-08T15:45:25.588977Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.2) starting as process 104965
2024-10-08T15:45:25.808928Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-10-08T15:45:26.093223Z 1 [ERROR] [MY-012574] [InnoDB] Unable to lock ./ibdata1 error: 11

2024-10-08T15:47:06.122776Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 11 in a file operation.
2024-10-08T15:47:06.122843Z 1 [ERROR] [MY-012596] [InnoDB] Error number 11 means 'Resource temporarily unavailable'
2024-10-08T15:47:06.122882Z 1 [ERROR] [MY-012215] [InnoDB] Cannot open datafile './ibdata1'
2024-10-08T15:47:06.122911Z 1 [ERROR] [MY-012959] [InnoDB] Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
2024-10-08T15:47:06.122989Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Cannot open a file.
2024-10-08T15:47:06.124982Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2024-10-08T15:47:06.125664Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2024-10-08T15:47:06.125802Z 0 [ERROR] [MY-010119] [Server] Aborting
2024-10-08T15:47:06.204196Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.2) MySQL Community Server - GPL.
2024-10-08T15:47:06.204280Z 0 [System] [MY-015016] [Server] MySQL Server - end.

This is my current /usr/lib/systemd/system/mysqld.service file:

[Unit]
Description=MySQL Server Documentation=man:mysqld(8)
Documentation=http://dev.mysql.com/doc/refman/en/using-systemd.html
After=network.target
After=syslog.target
[Install]
WantedBy=multi-user.target
[Service]
User=mysql
Group=mysql
# Have mysqld write its state to the systemd notify socket
Type=notify
NotifyAccess=all
# Disable service start and stop timeout logic of systemd for mysqld
# service.
TimeoutSec=0
# Start main service
ExecStart=mysqld --defaults-file=/etc/my.cnf
#$MYSQLD_OPTS
# Use this to switch malloc implementation
#EnvironmentFile=-/etc/sysconfig/mysql
# Sets open_files_limit
LimitNOFILE = 10000
Restart=on-failure
RestartPreventExitStatus=1
# Set environment variable MYSQLD_PARENT_PID. This is required for
# restart.
Environment=MYSQLD_PARENT_PID=1
PrivateTmp=false

This is my current /etc/systemd/system/mysqld.service

[Unit]
Description=MySQL Server Documentation=man:mysqld(8)
Documentation=http://dev.mysql.com/doc/refman/en/using-systemd.html
After=network.target
After=syslog.target
[Install]
WantedBy=multi-user.target
[Service]
User=mysql
Group=mysql
# Have mysqld write its state to the systemd notify socket
Type=notify
NotifyAccess=all
# Disable service start and stop timeout logic of systemd for mysqld
# service.
TimeoutSec=0
# Start main service
ExecStart=mysqld --defaults-file=/etc/my.cnf
#$MYSQLD_OPTS
# Use this to switch malloc implementation
EnvironmentFile=-/etc/sysconfig/mysql
# Sets open_files_limit
LimitNOFILE=10000
Restart=on-failure
RestartPreventExitStatus=1
# Set environment variable MYSQLD_PARENT_PID. This is required for
# restart.
Environment=MYSQLD_PARENT_PID=1
PrivateTmp=false

I am not sure why there are 2 mysqld.service files. This was an uninstall of 5.5.8 and install of 8.4.

Let me know what else you may need. I have stopped making any further changes without hearing from you. I did make a number of changes before hearing from you. I unrolled the directory changes. The socket file and error file are working and configured for /usr/local/mysql/data when starting from commandline. I had to change them to /tmp (just convenient location) to get in order to get a current error log file.

This is a backup server with no current mysql data and can have mysql installs removed and reinstalled if necessary. My active server is running mysql 5.5.8 and working fine. Data migration will be the next issue.

Options: ReplyQuote




Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.