# failed on start mysql80-server on FreeBSD12.0



## ykla (Dec 23, 2018)

Hi!
  I installed mysql80-server today, but I cant not start it.



```
root@VM_0_11_freebsd:/usr/ports/database
s/mysql80-server # p
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # pwd_mkdb -p /e
tc/master.passwd
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # sysrc mysql_en
able="yes"
mysql_enable:  -> yes
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # service mysql-
server start
/usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for mysql
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # service mysql-
server start
/usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for mysql
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # service mysql-
server stop
mysql not running? (check /var/db/mysql/VM_0_11_freebsd.pid).
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # rm -rf /var/db
/mysql/*
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # chown mysql:my
sql /var/db/mysql
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # service mysql-
server start
/usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for mysql
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # chown mysql:my
sql /usr/local/etc/mysql/my.cnf
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server #  /usr/local/li
bexec/initializemysqld
/usr/local/libexec/initializemysqld: Command not found.
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server #  /usr/local/li
bexec/initializemysqld

root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # 

root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # /usr/local/lib
exec/initialize      
/usr/local/libexec/initialize: Command not found.
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # /usr/local/lib
exec/mysqld-initialize
/usr/local/libexec/mysqld-initialize: Command not found.
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # /usr/local/lib
exec/mysqld -initialize
2018-12-23T05:56:04.114595Z 0 [Warning] [MY-011068] [Server] The syntax 'expire-logs-days' is deprecated and will be removed in a future release. Please use binlog_expire_logs_seconds instead.
2018-12-23T05:56:04.114805Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2018-12-23T05:56:04.116900Z 0 [System] [MY-010116] [Server] /usr/local/libexec/mysqld (mysqld 8.0.12) starting as process 47890
2018-12-23T05:56:04.156826Z 1 [ERROR] [MY-011011] [Server] Failed to find valid data directory.
2018-12-23T05:56:04.157252Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2018-12-23T05:56:04.157372Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-12-23T05:56:04.157738Z 0 [System] [MY-010910] [Server] /usr/local/libexec/mysqld: Shutdown complete (mysqld 8.0.12)  Source distribution.
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # 
[VM_0_11_freebsd][             (0*$ csh)             ][12/23/18  1:56 PM]
exec/initialize
/usr/local/libexec/initialize: Command not found.
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # /usr/local/lib
exec/mysqld-initialize
/usr/local/libexec/mysqld-initialize: Command not found.
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # /usr/local/lib
exec/mysqld -initialize
2018-12-23T05:56:04.114595Z 0 [Warning] [MY-011068] [Server] The syntax 'expire-logs-days' is deprecated and will be removed in a future release. Please use binlog_expire_logs_seconds instead.
2018-12-23T05:56:04.114805Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2018-12-23T05:56:04.116900Z 0 [System] [MY-010116] [Server] /usr/local/libexec/mysqld (mysqld 8.0.12) starting as process 47890
2018-12-23T05:56:04.156826Z 1 [ERROR] [MY-011011] [Server] Failed to find valid data directory.
2018-12-23T05:56:04.157252Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2018-12-23T05:56:04.157372Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-12-23T05:56:04.157738Z 0 [System] [MY-010910] [Server] /usr/local/libexec/mysqld: Shutdown complete (mysqld 8.0.12)  Source distribution.
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # s
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # service mysql-server start
/usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for mysql
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # mysql_secure_installation
mysql_secure_installation: [ERROR] unknown variable 'prompt=\u@\h [\d]>\_'

Securing the MySQL server deployment.

Enter password for user root: 
Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # /usr/local/libexec/mysqld -
initialize11_freebsd:/usr/ports/databases/mysql80-server # /usr/local/libexec/mysqld-i
nitialize_11_freebsd:/usr/ports/databases/mysql80-server # /usr/local/libexec/initiali
zemysqld0_11_freebsd:/usr/ports/databases/mysql80-server # chown mysql:mysql /usr/loca
l/etc/mysql/my.cnfsd:/usr/ports/databases/mysql80-server # service mysql-server start 
                  sd:/usr/ports/databases/mysql80-server # chown mysql:mysql /var/db/m
ysql@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # rm -rf /var/db/mysql/*     
    @VM_0_11_freebsd:/usr/ports/databases/mysql80-server # service mysql-server start

root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # 

root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # 

root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # service mysql-server start
/usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for mysql
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # mkdir -p /var/db/mysql/
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # service mysql-server start
/usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for mysql
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # mysql-server stop
mysql-server: Command not found.
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # service mysql-server stop 
mysql not running? (check /var/db/mysql/VM_0_11_freebsd.pid).
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # service mysql-server start
/usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for mysql
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # chown mysql:mysql /usr/loca
l/etc/mysql/my.cnf
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # /usr/local/libexec/inmimysql
doot@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # /usr/local/libexec/initmysq
ldot@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # /usr/local/libexec/initimys
qldt@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # /usr/local/libexec/initiamy
sqld@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # /usr/local/libexec/initialm
ysqldVM_0_11_freebsd:/usr/ports/databases/mysql80-server # /usr/local/libexec/initiali
zemysqld

root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # chown mysql:mysql /usr/loca
l/etc/mysql/my.cnf

root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # chown mysql:mysql /usr/loca
l/etc/mysql/my.cnf

root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # /usr/local/libexec/mysqld -
initialize
2018-12-23T06:01:11.239843Z 0 [Warning] [MY-011068] [Server] The syntax 'expire-logs-days' is deprecated and will be removed in a future release. Please use binlog_expire_logs_seconds instead.
2018-12-23T06:01:11.240039Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2018-12-23T06:01:11.242038Z 0 [System] [MY-010116] [Server] /usr/local/libexec/mysqld (mysqld 8.0.12) starting as process 47956
2018-12-23T06:01:11.280013Z 1 [ERROR] [MY-011011] [Server] Failed to find valid data directory.
2018-12-23T06:01:11.280395Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2018-12-23T06:01:11.280511Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-12-23T06:01:11.280890Z 0 [System] [MY-010910] [Server] /usr/local/libexec/mysqld: Shutdown complete (mysqld 8.0.12)  Source distribution.
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # cat /root/.
../       ./        .cshrc    .history  .k5login  .login    .profile  .ssh/
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # service mysql-server stop
mysql not running? (check /var/db/mysql/VM_0_11_freebsd.pid).
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # rm -rf /var/db/mysql/*
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # chown mysql:mysql /var/db/m
ysql 
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # service mysql-server start
/usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for mysql
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # mysqld --initialize-insecur
e --user=mysql
mysqld: Command not found.
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # mysqld --initialize-insecur
e --user=mysqlreebsd:/usr/ports/databases/mysql80-server # service mysql-server start 
              reebsd:/usr/ports/databases/mysql80-server # chown mysql:mysql /var/db/m
ysql@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # rm -rf /var/db/mysql/*     
    @VM_0_11_freebsd:/usr/ports/databases/mysql80-server # /usr/local/libexec/mysqld -
initialize11_freebsd:/usr/ports/databases/mysql80-server # chown mysql:mysql /usr/loca
l/etc/mysql/my.cnfsd:/usr/ports/databases/mysql80-server # /usr/local/libexec/mysqld -
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # /usr/local/libexec/mysqld  
--initialize-insecure --user=mysql
2018-12-23T06:05:48.470889Z 0 [Warning] [MY-011068] [Server] The syntax 'expire-logs-days' is deprecated and will be removed in a future release. Please use binlog_expire_logs_seconds instead.
2018-12-23T06:05:48.471222Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2018-12-23T06:05:48.471316Z 0 [System] [MY-013169] [Server] /usr/local/libexec/mysqld (mysqld 8.0.12) initializing of server in progress as process 47978
2018-12-23T06:05:48.473495Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
2018-12-23T06:05:48.473643Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-12-23T06:05:48.473888Z 0 [System] [MY-010910] [Server] /usr/local/libexec/mysqld: Shutdown complete (mysqld 8.0.12)  Source distribution.
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # rm -rf /var/db/mysql/*
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # /usr/local/libexec/mysqld -
-initialize-insecure --user=mysql
2018-12-23T06:06:14.265977Z 0 [Warning] [MY-011068] [Server] The syntax 'expire-logs-days' is deprecated and will be removed in a future release. Please use binlog_expire_logs_seconds instead.
2018-12-23T06:06:14.266224Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2018-12-23T06:06:14.266346Z 0 [System] [MY-013169] [Server] /usr/local/libexec/mysqld (mysqld 8.0.12) initializing of server in progress as process 47981
mysqld: Can't create/write to file '/var/db/mysql_tmpdir/ibpfGX9g' (OS errno 13 - Permission denied)
2018-12-23T06:06:14.308218Z 1 [ERROR] [MY-012576] [InnoDB] InnoDB: Unable to create temporary file; errno: 13
2018-12-23T06:06:14.308326Z 1 [ERROR] [MY-012929] [InnoDB] InnoDB: InnoDB Database creation was aborted with error Generic error. You may need to delete the ibdata1 file before trying to start up again.
2018-12-23T06:06:14.308590Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2018-12-23T06:06:14.308692Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-12-23T06:06:14.308997Z 0 [System] [MY-010910] [Server] /usr/local/libexec/mysqld: Shutdown complete (mysqld 8.0.12)  Source distribution.
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server #  chown root:root 
usage: chown [-fhvx] [-R [-H | -L | -P]] owner[:group] file ...   ][12/23/18  2:07 PM]
       chown [-fhvx] [-R [-H | -L | -P]] :group file ...
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server #  chown root:root /tmp
chown: root: illegal group name
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # chmod 1777 /tmp
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # /usr/local/libexec/mysqld -
-initialize-insecure --user=mysqlatabases/mysql80-server # rm -rf /var/db/mysql/*     
                                 atabases/mysql80-server # /usr/local/libexec/mysqld -
-initialize-insecure --user=mysql
2018-12-23T06:07:57.223447Z 0 [Warning] [MY-011068] [Server] The syntax 'expire-logs-days' is deprecated and will be removed in a future release. Please use binlog_expire_logs_seconds instead.
2018-12-23T06:07:57.223760Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2018-12-23T06:07:57.223882Z 0 [System] [MY-013169] [Server] /usr/local/libexec/mysqld (mysqld 8.0.12) initializing of server in progress as process 47986
2018-12-23T06:07:57.227024Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
2018-12-23T06:07:57.227379Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-12-23T06:07:57.227727Z 0 [System] [MY-010910] [Server] /usr/local/libexec/mysqld: Shutdown complete (mysqld 8.0.12)  Source distribution.
[VM_0_11_freebsd][                   (0*$ csh)                    ][12/23/18  2:08 PM]
2018-12-23T06:06:14.265977Z 0 [Warning] [MY-011068] [Server] The syntax 'expire-logs-da Please use binlog_expire_logs_seconds instead.
2018-12-23T06:06:14.266224Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links . Consider not using this option as it' is deprecated and will be removed in a future r
2018-12-23T06:06:14.266346Z 0 [System] [MY-013169] [Server] /usr/local/libexec/mysqld (ss 47981
mysqld: Can't create/write to file '/var/db/mysql_tmpdir/ibpfGX9g' (OS errno 13 - Permi
2018-12-23T06:06:14.308218Z 1 [ERROR] [MY-012576] [InnoDB] InnoDB: Unable to create tem
2018-12-23T06:06:14.308326Z 1 [ERROR] [MY-012929] [InnoDB] InnoDB: InnoDB Database crea delete the ibdata1 file before trying to start up again.
2018-12-23T06:06:14.308590Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initializati
2018-12-23T06:06:14.308692Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-12-23T06:06:14.308997Z 0 [System] [MY-010910] [Server] /usr/local/libexec/mysqld: 
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server #  chown root:root
usage: chown [-fhvx] [-R [-H | -L | -P]] owner[:group] file ...
       chown [-fhvx] [-R [-H | -L | -P]] :group file ...
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server #  chown root:root /tmp
chown: root: illegal group name
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # chmod 1777 /tmp
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # /usr/local/libexec/mysqld -
-initialize-insecure --user=mysqlatabases/mysql80-server # rm -rf /var/db/mysql/*
                                 atabases/mysql80-server # /usr/local/libexec/mysqld -
-initialize-insecure --user=mysql
2018-12-23T06:07:57.223447Z 0 [Warning] [MY-011068] [Server] The syntax 'expire-logs-da Please use binlog_expire_logs_seconds instead.
2018-12-23T06:07:57.223760Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links . Consider not using this option as it' is deprecated and will be removed in a future r
2018-12-23T06:07:57.223882Z 0 [System] [MY-013169] [Server] /usr/local/libexec/mysqld (ss 47986
2018-12-23T06:07:57.227024Z 0 [ERROR] [MY-010457] [Server] --initialize specified but t
2018-12-23T06:07:57.227379Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-12-23T06:07:57.227727Z 0 [System] [MY-010910] [Server] /usr/local/libexec/mysqld: 
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # 
[VM_0_11_freebsd][                                                 (0*$ csh)           
usage: chown [-fhvx] [-R [-H | -L | -P]] owner[:group] file ...
       chown [-fhvx] [-R [-H | -L | -P]] :group file ...
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server #  chown root:root /tmp
chown: root: illegal group name
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # chmod 1777 /tmp
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # /usr/local/libexec/mysqld -
-initialize-insecure --user=mysqlatabases/mysql80-server # rm -rf /var/db/mysql/*
                                 atabases/mysql80-server # /usr/local/libexec/mysqld -
-initialize-insecure --user=mysql
2018-12-23T06:07:57.223447Z 0 [Warning] [MY-011068] [Server] The syntax 'expire-logs-days' is deprecated and will be removed in a future release. Please use binlog_expire_logs_seconds instead.
2018-12-23T06:07:57.223760Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2018-12-23T06:07:57.223882Z 0 [System] [MY-013169] [Server] /usr/local/libexec/mysqld (mysqld 8.0.12) initializing of server in progress as process 47986
2018-12-23T06:07:57.227024Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
2018-12-23T06:07:57.227379Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-12-23T06:07:57.227727Z 0 [System] [MY-010910] [Server] /usr/local/libexec/mysqld: Shutdown complete (mysqld 8.0.12)  Source distribution.
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # /usr/local/libexec/mysqld -
-initialize-insecure --user=mysqlatabases/mysql80-server # chmod 1777 /tmp            
                                 atabases/mysql80-server # /usr/local/libexec/mysqld -
-initialize-insecure --user=mysqlatabases/mysql80-server # rm -rf /var/db/mysql/*     
                                 atabases/mysql80-server # rm -rf /var/db/mysql/*
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # /usr/local/libexec/mysqld -
-initialize-insecure --user=mysql
2018-12-23T06:08:30.390856Z 0 [Warning] [MY-011068] [Server] The syntax 'expire-logs-days' is deprecated and will be removed in a future release. Please use binlog_expire_logs_seconds instead.
2018-12-23T06:08:30.391065Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2018-12-23T06:08:30.391175Z 0 [System] [MY-013169] [Server] /usr/local/libexec/mysqld (mysqld 8.0.12) initializing of server in progress as process 47989
mysqld: Can't create/write to file '/var/db/mysql_tmpdir/ibYDdXcq' (OS errno 13 - Permission denied)
2018-12-23T06:08:30.437463Z 1 [ERROR] [MY-012576] [InnoDB] InnoDB: Unable to create temporary file; errno: 13
2018-12-23T06:08:30.437568Z 1 [ERROR] [MY-012929] [InnoDB] InnoDB: InnoDB Database creation was aborted with error Generic error. You may need to delete the ibdata1 file before trying to start up again.
2018-12-23T06:08:30.437950Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2018-12-23T06:08:30.438100Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-12-23T06:08:30.438583Z 0 [System] [MY-010910] [Server] /usr/local/libexec/mysqld: Shutdown complete (mysqld 8.0.12)  Source distribution.
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # rm -rf /var/db/mysql/*
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # chown mysql:mysql /var/db/m
ysql
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # chown mysql:mysql /var/db/m
ysql@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # rm -rf /var/db/mysql/*     
    @VM_0_11_freebsd:/usr/ports/databases/mysql80-server # /usr/local/libexec/mysqld -
-initialize-insecure --user=mysql
2018-12-23T06:09:08.619683Z 0 [Warning] [MY-011068] [Server] The syntax 'expire-logs-days' is deprecated and will be removed in a future release. Please use binlog_expire_logs_seconds instead.
2018-12-23T06:09:08.619860Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2018-12-23T06:09:08.619969Z 0 [System] [MY-013169] [Server] /usr/local/libexec/mysqld (mysqld 8.0.12) initializing of server in progress as process 47993
mysqld: Can't create/write to file '/var/db/mysql_tmpdir/ibnSSRdD' (OS errno 13 - Permission denied)
2018-12-23T06:09:08.660583Z 1 [ERROR] [MY-012576] [InnoDB] InnoDB: Unable to create temporary file; errno: 13
2018-12-23T06:09:08.660678Z 1 [ERROR] [MY-012929] [InnoDB] InnoDB: InnoDB Database creation was aborted with error Generic error. You may need to delete the ibdata1 file before trying to start up again.
2018-12-23T06:09:08.660947Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2018-12-23T06:09:08.661052Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-12-23T06:09:08.661401Z 0 [System] [MY-010910] [Server] /usr/local/libexec/mysqld: Shutdown complete (mysqld 8.0.12)  Source distribution.
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # /usr/local/libexec/mysqld -
-initialize-insecure --user=mysqlatabases/mysql80-server # chown mysql:mysql /var/db/m
ysql@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # rm -rf /var/db/mysql/*     
    @VM_0_11_freebsd:/usr/ports/databases/mysql80-server # chown mysql:mysql /var/db/m
ysql@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # rm -rf /var/db/mysql/*     
    @VM_0_11_freebsd:/usr/ports/databases/mysql80-server # /usr/local/libexec/mysqld -
-initialize-insecure --user=mysqlatabases/mysql80-server # rm -rf /var/db/mysql/*     
                                 atabases/mysql80-server # rm -rf /var/db/mysql/*
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # /usr/local/libexec/mysqld -
-initialize-insecure --user=mysqlatabases/mysql80-server # chown mysql:mysql /var/db/m
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # chown mysql:mysql /var/db/ 
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # /usr/local/libexec/mysqld -
-initialize-insecure --user=mysql
2018-12-23T06:09:37.430780Z 0 [Warning] [MY-011068] [Server] The syntax 'expire-logs-days' is deprecated and will be removed in a future release. Please use binlog_expire_logs_seconds instead.
2018-12-23T06:09:37.430967Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2018-12-23T06:09:37.431065Z 0 [System] [MY-013169] [Server] /usr/local/libexec/mysqld (mysqld 8.0.12) initializing of server in progress as process 47996
mysqld: Can't create/write to file '/var/db/mysql_tmpdir/ibEHCcxn' (OS errno 13 - Permission denied)
2018-12-23T06:09:37.471603Z 1 [ERROR] [MY-012576] [InnoDB] InnoDB: Unable to create temporary file; errno: 13
2018-12-23T06:09:37.471695Z 1 [ERROR] [MY-012929] [InnoDB] InnoDB: InnoDB Database creation was aborted with error Generic error. You may need to delete the ibdata1 file before trying to start up again.
2018-12-23T06:09:37.471952Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2018-12-23T06:09:37.472053Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-12-23T06:09:37.472371Z 0 [System] [MY-010910] [Server] /usr/local/libexec/mysqld: Shutdown complete (mysqld 8.0.12)  Source distribution.
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # mysql_install_db
mysql_install_db: Command not found.
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server # /usr/local/etc/rc.d/mysql-s
erver start
/usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for mysql
root@VM_0_11_freebsd:/usr/ports/databases/mysql80-server #
```


----------



## ShelLuser (Dec 23, 2018)

Do you have a my.cnf file set up? If so, what's in it? You might want to try and move it out of the way to see if that helps things.

Next you could add a logging section, try to start MySQL and see what it tells you:


```
#log_output = FILE
#general_log = 1
#general_log_file = /var/log/mysql.log
#slow_query_log_file = /var/log/mysql/mysql_slow.log
```

And finally you can also try to start the daemon manually (as root) to see if the console output tells you anything useful. See mysqld(8) for more on that.


----------



## ykla (Dec 23, 2018)

ShelLuser said:


> Do you have a my.cnf file set up? If so, what's in it? You might want to try and move it out of the way to see if that helps things.
> 
> Next you could add a logging section, try to start MySQL and see what it tells you:
> 
> ...



I had added them in my.cnf, and then it shows  me:

```
root@VM_0_11_freebsd:~ # service mysql-server start
/usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for mysql
root@VM_0_11_freebsd:~ # mysql_secure_installation
mysql_secure_installation: [ERROR] unknown variable 'prompt=\u@\h [\d]>\_'

Securing the MySQL server deployment.

Enter password for user root:
Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
root@VM_0_11_freebsd:~ #
```


----------



## ShelLuser (Dec 23, 2018)

ykla said:


> I had added them in my.cnf, and then it shows  me:
> 
> ```
> root@VM_0_11_freebsd:~ # service mysql-server start
> ...


Do you have anything else in my.cnf? Because it looks like that could be the cause of your problems. Try moving that file out of the way (rename it) and then try starting MySQL again.

Also: if you tried to start MySQL with the log entries I shared (I do assume that you uncommented them by removing the # characters) then you should also see more information in those logfiles.

So also check /var/log/mysql.log to see what it says.


----------



## SirDice (Dec 24, 2018)

```
rm -rf /var/db/mysql/*
service mysql-server start
```
There's no need to do any complicated initialization. The rc(8) script will already take care of this if /var/db/mysql/ is empty. But /var/db/mysql/ has to be really clean, not even a .snap directory or other 'hidden' directories and/or files.


----------



## ykla (Dec 30, 2018)

I reinstalled it, and deleted user mysql. Then I created user mysql and installed mysql. Finally I made it. Maybe caused by it.


----------



## robballan (Jul 23, 2019)

Same problem, downgrading, reinstalling both 57 and 80, deleting user, etc. Nothing is working. Data dictionary error continues with original /var/db/mysql directory, although when cleaned mysql will start correctly.

If someone can recommend a method of starting with a clean directory and then somehow importing tables from the old one, please advise.


----------



## SirDice (Jul 23, 2019)

robballan said:


> If someone can recommend a method of starting with a clean directory


`service mysql-server stop`
`rm -rf /var/db/mysql/*`
`service mysql-server start`

See post #5.


----------



## ranvel (Nov 28, 2019)

I think that I'm having this same issue - I upgraded from mysql57-server -> mysql80-server, after that, it didn't start again. I stopped mysql-server,  and then  deleted and reinstalled  all the packages. Next, I forcefully deleted  `/var/db/mysql/*` and `/usr/local/etc/mysql/*` and then tried to restart. Using truss, it was getting hung up on a .pid (repeated maybe 20 times): 
`fstatat(AT_FDCWD,"/var/db/mysql/hostname.pid",0x7fffffffdc18,0x0) ERR#2 'No such file or directory'`
Which was the same problem I was having before I tried any of these steps. I'm not sure why this is happening, but I'm throwing in the towel and rolling back to a backup.


----------



## SirDice (Nov 28, 2019)

ranvel said:


> Next, I forcefully deleted `/var/db/mysql/*`


I hope you didn't have anything important you needed to migrate because this destroyed all existing databases.

Look in /var/db/mysql/`hostname -f`.err for errors or other clues why it's not working.


----------



## ranvel (Nov 28, 2019)

Thanks so much for this great information, SirDice! You always are so helpful on this forum.

I don't know what the issue was, but I think I may have been trying to use a package for 12.1 on 12.0 or maybe failing to `service mysql-server stop` before updating.   In any case, it is working now.


----------

