I have a fresh install of databases/mysql80-server version 8.0.21 (installed using
System details from
To start off, when I run
If I run it as a regular user, it prints "/usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for mysql"
After running it either way, when I run
So, next I checked the contents of /var/db/mysql/freebsd.err:
I've seen reports that issues may happen when permissions aren't right for the mysql directories, so I've checked them to ensure that the mysql user is the owner.
I've also made sure to add
to /etc/rc.conf
My configuration file /usr/local/etc/mysql/my.cnf
Some other things I've tried to get this working:
Deleting the contents of /var/db/mysql then running
Deleting the contents of /var/db/mysql then running
After that, running
I've also tried running
After running that, I checked /var/db/mysql/freebsd.err again, and it only has two new lines:
I've tried uninstalling, deleting the old mysql user, then reinstalling, and the issue still happens. I've tried uninstalling and using databases/mysql57-server instead, but that version had the same issue, and I'd rather get the latest version working right anyways.
At this point I'm out of ideas, so any help would be appreciated.
pkg install mysql80-server
), and when I attempt to start the service, it doesn't seem to actually start. I've looked through threads on this forum and a few others, and still haven't found a solution, so I'll post what I have done to track down the issue so far and hope someone can point me in the right direction.System details from
freebsd-version ; uname -a
:
Code:
12.1-RELEASE-p8
FreeBSD freebsd 12.1-RELEASE-p8 FreeBSD 12.1-RELEASE-p8 GENERIC amd64
service mysql-server start
as superuser, it prints "Starting mysql."If I run it as a regular user, it prints "/usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for mysql"
After running it either way, when I run
service mysql-server status
, it prints "mysql is not running."So, next I checked the contents of /var/db/mysql/freebsd.err:
Code:
2020-08-14T05:45:27.6NZ mysqld_safe Logging to '/var/db/mysql/freebsd.err'.
2020-08-14T05:45:27.6NZ mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
2020-08-14T05:45:27.460682Z 0 [System] [MY-010116] [Server] /usr/local/libexec/mysqld (mysqld 8.0.21) starting as process 36670
2020-08-14T05:45:27.505797Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-08-14T05:45:30.6NZ mysqld_safe mysqld from pid file /var/db/mysql/freebsd.pid ended
ls -lh /var/db
Code:
drwxr-x--- 6 mysql mysql 1.0K Aug 14 05:45 mysql
drwxr-x--- 2 mysql mysql 512B Aug 9 01:23 mysql_secure
drwxr-x--- 2 mysql mysql 512B Aug 14 05:45 mysql_tmpdir
I've also made sure to add
Code:
mysql_enable="YES"
My configuration file /usr/local/etc/mysql/my.cnf
Code:
# $FreeBSD: branches/2020Q3/databases/mysql80-server/files/my.cnf.sample.in 469734 2018-05-12 15:35:25Z mmokhi $
[client]
port = 3306
socket = /tmp/mysql.sock
[mysql]
prompt = \u@\h [\d]>\_
no_auto_rehash
[mysqld]
user = mysql
port = 3306
socket = /tmp/mysql.sock
bind-address = 127.0.0.1
basedir = /usr/local
datadir = /var/db/mysql
tmpdir = /var/db/mysql_tmpdir
slave-load-tmpdir = /var/db/mysql_tmpdir
secure-file-priv = /var/db/mysql_secure
log-bin = mysql-bin
log-output = TABLE
master-info-repository = TABLE
relay-log-info-repository = TABLE
relay-log-recovery = 1
slow-query-log = 1
server-id = 1
sync_binlog = 1
sync_relay_log = 1
binlog_cache_size = 16M
binlog_expire_logs_seconds = 2592000
default_password_lifetime = 0
enforce-gtid-consistency = 1
gtid-mode = ON
safe-user-create = 1
lower_case_table_names = 1
explicit-defaults-for-timestamp = 1
myisam-recover-options = BACKUP,FORCE
open_files_limit = 13635
table_open_cache = 6737
table_definition_cache = 8192
net_retry_count = 16384
key_buffer_size = 256M
max_allowed_packet = 64M
long_query_time = 1
innodb_buffer_pool_size = 1G
innodb_data_home_dir = /var/db/mysql
innodb_log_group_home_dir = /var/db/mysql
innodb_data_file_path = ibdata1:128M:autoextend
innodb_temp_data_file_path = ibtmp1:128M:autoextend
innodb_flush_method = O_DIRECT
innodb_log_file_size = 256M
innodb_log_buffer_size = 16M
innodb_write_io_threads = 8
innodb_read_io_threads = 8
innodb_autoinc_lock_mode = 2
#skip-symbolic-links
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
[mysqldump]
max_allowed_packet = 256M
quote_names
quick
Some other things I've tried to get this working:
Deleting the contents of /var/db/mysql then running
service mysql-server start
.Deleting the contents of /var/db/mysql then running
/usr/local/libexec/mysqld --initialize --user=mysql
, which produces:
Code:
2020-08-14T06:17:33.347813Z 0 [System] [MY-013169] [Server] /usr/local/libexec/mysqld (mysqld 8.0.21) initializing of server in progress as process 37427
2020-08-14T06:17:33.382282Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-08-14T06:17:47.056786Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
mysqld: Error on delete of './auto.cnf' (OS errno 2 - No such file or directory)
2020-08-14T06:17:49.456251Z 0 [Warning] [MY-010107] [Server] World-writable config file './auto.cnf' has been removed.
2020-08-14T06:17:50.001328Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: REDACTED
service mysql-server start
still just prints "Starting mysql." and the contents of /var/db/mysql/freebsd.err are the same as earlier with different timestamps.I've also tried running
mysqld_safe
directly, which produces the following console output:
Code:
2020-08-14T06:07:41.6NZ mysqld_safe Logging to '/var/db/mysql/freebsd.err'.
2020-08-14T06:07:41.6NZ mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
$ Killed
2020-08-14T06:07:45.6NZ mysqld_safe mysqld from pid file /var/db/mysql/freebsd.pid ended
Code:
2020-08-14T06:07:41.570113Z 0 [System] [MY-010116] [Server] /usr/local/libexec/mysqld (mysqld 8.0.21) starting as process 37389
2020-08-14T06:07:41.606885Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
I've tried uninstalling, deleting the old mysql user, then reinstalling, and the issue still happens. I've tried uninstalling and using databases/mysql57-server instead, but that version had the same issue, and I'd rather get the latest version working right anyways.
At this point I'm out of ideas, so any help would be appreciated.