1

I am having the same issue as this person serverfault link but the solution completely does not work for me. I cannot start mysql5.5 for the very first time. At first start of mysql with

cd /usr/local ; /usr/local/bin/mysqld_safe &

other attempted switches ->

--user=mysql --socket=/var/run/mysql/mysql.sock

I have reinstalled the database using:

mysql_install_db  --user=mysql --basedir=/usr/local --datadir=/var/db/mysql

I have reinstalled in every possible combination and always the same error

150309 06:20:27 mysqld_safe Starting mysqld daemon with databases from /usr/local/bin/data/mysql
150309  6:20:27 [Note] Plugin 'InnoDB' is disabled.
/usr/local/libexec/mysqld: Table 'mysql.plugin' doesn't exist
150309  6:20:27 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
150309  6:20:27 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
150309  6:20:27 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
150309  6:20:27 [Note] Server socket created on IP: '0.0.0.0'.
150309  6:20:27 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
150309 06:20:27 mysqld_safe mysqld from pid file /usr/local/bin/data/mysql/yoda.com.pid ended

permission on my data dir/ are:

[\u@yoda:/usr/local] # ls -l /usr/local/bin/data
total 110700
-rw-rw----  1 root   wheel  50331648 Mar  8 19:50 ib_logfile0
-rw-rw----  1 root   wheel  50331648 Mar  8 19:50 ib_logfile1
-rw-rw----  1 root   wheel  12582912 Mar  8 19:50 ibdata1
drwxrwxr-x  2 mysql  mysql       512 Mar  9 06:20 mysql
drwx------  2 root   wheel      2560 Mar  8 19:50 performance_schema
drwx------  2 root   wheel       512 Mar  8 19:50 test

[\u@yoda:/usr/local] # ls -l /usr/local/bin/data/mysql/
total 8
-rw-r-----  1 mysql  mysql  4632 Mar  9 06:20 yoda.com.err

[\u@yoda:/usr/local] # ls -l /var/db/
total 1776
drwxr-xr-x   5 mysql     mysql         512 Mar  9 04:44 mysql

[\u@yoda:/usr/local] # ls -l /var/db/mysql/
total 12436
-rw-rw----  1 mysql  mysql  12582912 Mar  8 11:37 ibdata1
drwx------  2 mysql  mysql      2048 Mar  9 04:02 mysql
drwx------  2 mysql  mysql      1024 Mar  9 04:44 performance_schema
drwx------  2 mysql  mysql       512 Mar  8 11:43 test
-rw-r-----  1 mysql  mysql    104477 Mar  9 03:56 yoda.com.err

How do you get mysql fired up on FreeBSD?

mine
  • 197
  • 1
  • 4
  • 14
  • You've not shown the permissions of the directory `/var/db/mysql`. Also, the permissions of `/var/db` would be interesting and possibly useful. – Jenny D Mar 10 '15 at 16:03
  • Here is a procedure that work on Centos/Redhat please do the same on the FreeBSD http://stackoverflow.com/questions/9083408/fatal-error-cant-open-and-lock-privilege-tables-table-mysql-host-doesnt-ex – Ali Mezgani Mar 10 '15 at 16:22
  • Did you maybe try to do: # chmod 1777 /var/tmp and then restart mysql? – Jakov Sosic Mar 10 '15 at 15:56
  • The permissions `1777` are way too permissive and should only be used temporarily, and should generally be avoided. Leaving those in place for a long time is a security problem. – Stefan Lasiewski Mar 10 '15 at 16:23
  • It's meant for /var/tmp, isn't that the default permission for that dir in the first place? – Jakov Sosic Mar 10 '15 at 16:31
  • Yup idea is that MySQL probably can't create tmp tables... Other option would be to change tmpdir in my.cnf to some dir and then own that dir to mysql exclusively. But, we'll have to wait for the OP to check this solution to know if I'm on correct track. – Jakov Sosic Mar 10 '15 at 16:44
  • chmod 777 is very wrong. the correct permission are 755. I did try 777, nah-dah. – mine Mar 10 '15 at 17:33
  • It's not wrong for TMP dirs. Take a look at permissions on those dirs (/tmp and /var/tmp) on freshly installed os. – Jakov Sosic Mar 10 '15 at 18:32

0 Answers0