Bug 209512 - mysql57-server-5.7.12: Server not usable after installation
Summary: mysql57-server-5.7.12: Server not usable after installation
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Many People
Assignee: Kurt Jaeger
URL:
Keywords:
Depends on: 209510
Blocks:
  Show dependency treegraph
 
Reported: 2016-05-15 00:40 UTC by Regulus Kean
Modified: 2019-05-10 17:13 UTC (History)
8 users (show)

See Also:


Attachments
Patch that fixes perms of my.cnf in pkg-plist (923 bytes, patch)
2016-05-16 16:57 UTC, Mahdi Mokhtari
mmokhi: maintainer-approval+
Details | Diff
fix my.cnf perms and restores my.cnf search paths (4.26 KB, patch)
2016-05-17 13:28 UTC, Markus Kohlmeyer
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Regulus Kean 2016-05-15 00:40:29 UTC
I hope this is the right place to report this bug:

When I run "pkg install mysql57-server-5.7.12" on a quite fresh install of 10.3-RELEASE on amd64, the installation completes without an error, but the mysql server does not start.

Even after adding 'mysql_enable="YES"' to /etc/rc.conf, running "service mysql-server start" results in:
"/usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for mysql"
The server will remain down.

Running "/usr/local/libexec/mysqld" manually, part of the output reads:
"mysqld: Table 'mysql.plugin' doesn't exist
2016-05-14T22:36:31.093854Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
mysqld: Error on delete of './auto.cnf' (Errcode: 2 - No such file or directory)
2016-05-14T22:36:31.115349Z 0 [Warning] World-writable config file './auto.cnf' has been removed.
[...]
2016-05-14T22:36:32.480871Z 0 [Warning] Failed to open optimizer cost constant tables

2016-05-14T22:36:32.481295Z 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
2016-05-14T22:36:32.481436Z 0 [ERROR] Aborting"

The process then terminates in what appears to be a graceful manner.

If I can help sort this out, please let me know how, but please keep in mind that I'm quite new to FreeBSD and thus may need certain things to be spelled out to me.

Thanks!
Comment 1 Kurt Jaeger freebsd_committer 2016-05-15 20:07:31 UTC
Have you tried to run

mysql_upgrade

as the errorlog suggests ?
Comment 2 Regulus Kean 2016-05-15 20:40:50 UTC
(In reply to Kurt Jaeger from comment #1)
Hello,

thanks for the suggestion! Indeed I had tried it, but forgotten to include this in my report.

When I run mysql_upgrade, I get the following error:

mysql_upgrade: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) while connecting to the MySQL server
Upgrade process encountered error and will not continue.

So unfortunately, this does not seem to help, since the server won't start in the first place.
Comment 3 Kurt Jaeger freebsd_committer 2016-05-15 21:07:40 UTC
i have reproduced the problem.
Comment 4 Markus Kohlmeyer 2016-05-15 21:36:52 UTC
Can you please backup your /var/db/mysql or whereever your dbdir is located and then ´rm -r /var/db/mysql/*` and edit /usr/local/etc/rc.d/mysql-server line 60 by temporarely removing the " >/dev/null 2>/dev/null" and then run "service mysql-server start" again, pasting the full onscreen output here please.
Afterwards you can revert previous changes.

Thanks.
Comment 5 Regulus Kean 2016-05-15 22:04:38 UTC
Certainly. What I get now is this:

2016-05-15 21:54:19 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize
2016-05-15 21:54:19 [ERROR]   Child process: /usr/local/libexec/mysqldterminated prematurely with errno= 32
2016-05-15 21:54:19 [ERROR]   Failed to execute /usr/local/libexec/mysqld --defaults-extra-file=/usr/local/etc/mysql/my.cnf --bootstrap --datadir=/var/db/mysql --lc-messages-dir=/usr/local/share/mysql --lc-messages=en_US --basedir=/usr/local
-- server log begin --
mysqld: [ERROR] Could not open required defaults file: /usr/local/etc/mysql/my.cnf
mysqld: [ERROR] Fatal error in defaults handling. Program aborted!

-- server log end --
/usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for mysql


The file in question exists, but has the following permissions:
-rw-r-----  1 root  wheel  2319 May 12 06:03 /usr/local/etc/mysql/my.cnf

Changing the file's group to "mysql" seems to fix this issue. Issuing "service mysql-server start" now gives:


2016-05-15 21:59:21 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize
2016-05-15 21:59:57 [WARNING] The bootstrap log isn't empty:
2016-05-15 21:59:57 [WARNING] 2016-05-15T19:59:21.636758Z 0 [Warning] --bootstrap is deprecated. Please consider using --initialize instead
2016-05-15T19:59:21.639688Z 0 [Warning] Could not increase number of max_open_files to more than 28701 (request: 32929)
2016-05-15T19:59:21.639724Z 0 [Warning] Changed limits: table_open_cache: 14270 (requested 16384)

Starting mysql.


And indeed, the server is running now, and also after rebooting the machine.

Thank you very much for your help! Of course, I'd be glad to test out patches to see whether installing an updated package results in a running mysql server right away.
Comment 6 Markus Kohlmeyer 2016-05-15 22:46:11 UTC
Thanks, that issue is known and will be fixed in the next update.
Comment 7 Markus Kohlmeyer 2016-05-16 00:58:55 UTC
Temporary fix:

chown root:wheel /usr/local/etc/mysql/my.cnf{,.sample}
chmod 0644 /usr/local/etc/mysql/my.cnf{,.sample}
Comment 8 Mahdi Mokhtari freebsd_committer freebsd_triage 2016-05-16 16:57:26 UTC
Created attachment 170371 [details]
Patch that fixes perms of my.cnf in pkg-plist

Thanks to Markus, this patch fixes permissions of files in pkg-plist and increases PORTREVISION too
Comment 9 Mahdi Mokhtari freebsd_committer freebsd_triage 2016-05-16 16:58:43 UTC
QA done.
Portlint -AC : okay
poudriere    : builds fine
Comment 10 Mahdi Mokhtari freebsd_committer freebsd_triage 2016-05-16 17:04:02 UTC
I marked this issue/PR depended to other one to avoid bundling all changes for opened issues in one patch and also to avoid conflicts for commit time (as a bug triage point)
Comment 11 Miroslav Lachman 2016-05-16 21:03:46 UTC
/usr/local/etc/mysql/my.cnf - Is this the new default path for my.cnf?


Because it was /usr/local/etc/my.cnf in older versions of MySQL and MariaDB
(I am not currently using MySQL 5.7 just looking to potential problem with upgrade.)
Comment 12 Markus Kohlmeyer 2016-05-16 21:10:33 UTC
Yes, that is the new (and correct) location for my.cnf and keyring
Comment 13 Miroslav Lachman 2016-05-16 22:14:55 UTC
When and why it was changed?
/usr/local/etc/my.cnf was there for a decade and I remember the problem (mysql not starting after upgrade) with unintentional change in early versions of MariaDB port where /usr/local/etc/my.cnf was ignored.

This is not expected result and thus it should be mentioned in UPDATING file.

I know it is displayed by rc script, but it doesn't help in automated environments. UPDATING is there for things like this.

I also think that all mysql ports (mysql / mariadb / percona) should use the same config locations and similar rc scripts even if they are maintained by different persons. These ports should work as compatible replacements.
For example MariaDB supports instances.
Comment 14 Markus Kohlmeyer 2016-05-16 23:23:41 UTC
(In reply to Miroslav Lachman from comment #13)

It was changed with the update to MySQL 5.7.12.
5.7.12 adds the new keyring plugin which needs its keyring file in etc/mysql/keyring therefor etc/mysql had to be created nonetheless.
As etc/mysql is the standard location for my.cnf in most to nearly all other OS it was the right moment to bring FreeBSD in par with the rest of the world.
BTW: FreeBSDs default location for my.cnf was /var/db/mysql/my.cnf and not /usr/local/etc/my.cnf

As for UPDATING you're right and i mentioned that two or three times before while we prepared the update. That was forgotten somehow, but it will be done hopefully soon.


As for the other ports, i've done most backports for MySQL 5.6 the last days. MariaDB 10 and Percona 5.6 will follow in the next weeks.

Not sure if i'll also prepare backports for MySQL/MariaDB/Percona 5.5 as they're IMHO not widely used anymore and should be removed from ports instead.
Comment 15 Miroslav Lachman 2016-05-17 00:27:36 UTC
I was not talking about rc conf defaults but compile time defaults.
According to MySQL and MariaDB documentation
http://dev.mysql.com/doc/refman/5.7/en/option-files.html
https://mariadb.com/kb/en/mariadb/configuring-mariadb-with-mycnf/

/etc/my.cnf	Global
/etc/mysql/my.cnf	Global
SYSCONFDIR/my.cnf	Global
$MYSQL_HOME/my.cnf	Server
defaults-extra-file	File specified with --defaults-extra-file=path, if any
~/.my.cnf	User

So in FreeBSD world, where everything from ports should have its files under /usr/local prefix, the first search location should be /usr/local/etc/my.cnf, the second /usr/local/etc/mysql/my.cnf and third /var/db/mysql/my.cnf (DATADIR)
AFAIK this is how it works for a decade.

It was already discussed in  Bug 182547

I am not against changing defaults in rc script but I think the defaults for mysql server it-self should be left unchanged.
Comment 16 Markus Kohlmeyer 2016-05-17 10:51:07 UTC
Thanks for the reference to bug #182547 which helped me a bit.

Seems like it would be enough to remove -DSYSCONFDIR="${ETCDIR}" from the CMAKE_ARGS to get the compile time default back.

As for the new runtime default of /usr/local/etc/mysql/my.cnf i'll suggest adding some more hints/warnings displayed to users in rc-script and of course UPDATING.

Do you agree with that? Or am i missing something again?
Comment 17 Miroslav Lachman 2016-05-17 11:40:04 UTC
I don't have time to test -DSYSCONFDIR modification now (maybe later this week).

I think it will be fine if default runtime location (default in rc.d/mysql-server) will be changed to /usr/local/etc/mysql/my.cnf with some warning and info in UPDATING as long as all three locations remains functional: 
/usr/local/etc/my.cnf
/usr/local/etc/mysql/my.cnf
/var/db/mysql/my.cnf

It can be checked by command my_print_defaults --help
Comment 18 Markus Kohlmeyer 2016-05-17 11:50:20 UTC
Without -DSYSCONFDIR it is now as it was in the past:

[root@devnoip:~] # /usr/local/libexec/mysqld --verbose --help | grep -A1 'Default options'
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/my.cnf /usr/local/etc/mysql/my.cnf ~/.my.cnf
Comment 19 Mahdi Mokhtari freebsd_committer freebsd_triage 2016-05-17 12:04:50 UTC
(In reply to Markus Kohlmeyer from comment #16)
If we remove -DSYSCONFDIR, it will be empty and search will prefer mysql's second choice (that is /etc/my.cnf) right?
I'm not asking because i planned to do it or not to do it, i juts wanna know how will be behave of KEYRINGDIR in that case ?

(In reply to Miroslav Lachman from comment #15)
Also, if mysql changed its behavior, what's the exact conflict of our change and hier(7) ? can anyone please explain this case in brief ?

I guess if conflict is only between MySQL-type DBs we can talk with other maintainers about it.
Comment 20 Mahdi Mokhtari freebsd_committer freebsd_triage 2016-05-17 12:07:04 UTC
(In reply to Miroslav Lachman from comment #17)
(In reply to Mahdi Mokhtari from comment #19)
I should add, if we rich to any conclusion that makes sense and is logical concern, i have enough time/energy/... to test and check results with honors ;)
Comment 21 Mahdi Mokhtari freebsd_committer freebsd_triage 2016-05-17 12:07:19 UTC
(In reply to Mahdi Mokhtari from comment #20)
errrr reach ;D
Comment 22 Miroslav Lachman 2016-05-17 12:33:10 UTC
(In reply to Markus Kohlmeyer from comment #18)
I think /etc/my.cnf and /etc/mysql/my.cnf should be removed. It was discussed in Bug 182547 (according to hier(7))
/etc/my.cnf and /etc/mysql/my.cnf should be replaced by their /usr/local/ counterparts. /usr/local/etc/my.cnf and /usr/local/etc/mysql/my.cnf should not be added to the end of the list. IMHO.

We have this on all our MariaDB instances:

my_print_defaults --help | grep -A1 'Default options'
Default options are read from the following files in the given order:
/usr/local/etc/my.cnf /usr/local/etc/mysql/my.cnf ~/.my.cnf

And /var/db/mysql/my.cnf is specified as extra-file

--defaults-extra-file=/var/db/mysql/my.cnf


(In reply to Mahdi Mokhtari from comment #19)
There is one dangerous problem with changing my.cnf locations and search path.
If you have working MySQL server with configuration in /usr/local/etc/my.cnf and you configure some non-default things for InnoDB like different file names, number of files for innodb_data_file_path or innodb_log_files_in_group, or size of innodb_log_file_size then if something with my.cnf is silently changed and your MySQL server will restart after upgrade without this my.cnf file or if it find some my.cnf file in location previously not scanned, your MySQL server will not start (if you are lucky) or start and try to create missing files. It will end up in non working or half broken MySQL server and you will have hard time to find what is going on.

This is why changing my.cnf search path is dangerous.

So the change is not related to hier(7) only. 
Hier just says:
    /etc/   system configuration files and scripts

Anything from ports / pkg should go to /usr/local prefix, and /usr/local/etc/ should mimics /etc/

Searching for my.cnf in /etc/ and /etc/mysql/ is the same as searching httpd.conf in /etc/ and /etc/apache24/. 
It is wrong on FreeBSD. 
But it is OK on operating systems where base system and 3rd party packages are not separated to /usr/local/.
Comment 23 Mahdi Mokhtari freebsd_committer freebsd_triage 2016-05-17 12:39:24 UTC
(In reply to Miroslav Lachman from comment #22)
as far as i followed discussion i guess all things started from this.
> /usr/local/etc/mysql/my.cnf - Is this the new default path for my.cnf?
then what's its problem with hier(7) :D ?
this is what i cant figure-out :D
Comment 24 Miroslav Lachman 2016-05-17 12:44:12 UTC
(In reply to Mahdi Mokhtari from comment #23)

/usr/local/etc/mysql/my.cnf - this change is not related to hier(7), it is completely fine to have this file here.
The problem is moving my.cnf file for existing installations as I explained before.
Comment 25 Mahdi Mokhtari freebsd_committer freebsd_triage 2016-05-17 12:53:33 UTC
(In reply to Mahdi Mokhtari from comment #23)
Okay.
Now we made our problem specific tight one which has clear solution (which means no need to remove SYSCONFDIR IMO :D)

My suggestion is we can create symlinks, to keep compatibility (we've done similar thing for libmysql too :D)
If you both guys agree with this i will add post-install: target to Makefile ;)
Comment 26 Mahdi Mokhtari freebsd_committer freebsd_triage 2016-05-17 13:05:52 UTC
(In reply to Mahdi Mokhtari from comment #25)
Any opinions on that ?
Comment 27 Markus Kohlmeyer 2016-05-17 13:11:29 UTC
(In reply to Miroslav Lachman from comment #22)

So you suggest that we backport databases/mariadb101-server/files/patch-mysys_my__default.c to mysql5[67]-server?


(In reply to Mahdi Mokhtari from comment #25)

No, that is not necessary and might conflict with pkg-plist



I'm currently testing without -DSYSCONFDIR which seems to be enough now. Longterm it seems legit to backport above MariaDB patch.
Comment 28 Mahdi Mokhtari freebsd_committer freebsd_triage 2016-05-17 13:25:52 UTC
(In reply to Markus Kohlmeyer from comment #27)
> So you suggest that we backport databases/mariadb101-server/files/patch-mysys_my__default.c to mysql5[67]-server?

can you please explain how you concluded this from his words?


> No, that is not necessary and might conflict with pkg-plist
>
> I'm currently testing without -DSYSCONFDIR which seems to be enough now. Longterm it seems legit to backport above MariaDB patch.

as you reported before deleting SYSCONFDIR results in  "/etc/my.cnf /etc/mysql/my.cnf ..." that the first two are wrong according hier(7) [i assume that was reason we used SYSCONFDIR in upgrade patch]

Also how it can have pkg-plist ?
as i told we're now using similar solution for libmysqlclient.so and libmysqlclient_r.so users (who are doing upgrade from 56)  [i guess at least we can do it till all maintainers of all mysql-like ports agree on migrating to new dir]
Comment 29 Markus Kohlmeyer 2016-05-17 13:28:02 UTC
Created attachment 170406 [details]
fix my.cnf perms and restores my.cnf search paths


Proposed patch to fix the perms of my.cnf to 0644 and to restore previous search patch of my.cnf
Comment 30 Mahdi Mokhtari freebsd_committer freebsd_triage 2016-05-17 13:28:47 UTC
(In reply to Mahdi Mokhtari from comment #28)
> can you please explain how you concluded this from his words?
FWIW, im not opposite of this way too ;)
i just thought i missed a point from his words
Comment 31 Mahdi Mokhtari freebsd_committer freebsd_triage 2016-05-17 13:30:56 UTC
(In reply to Markus Kohlmeyer from comment #29)
I guess maybe we can think/discuss more before making such huge changes, if you agree too :D
Comment 32 Markus Kohlmeyer 2016-05-17 13:41:32 UTC
(In reply to Mahdi Mokhtari from comment #28)

The patch from MariaDB removes /etc{,mysql} from the search path for my.cnf as suggested by Miroslav.
I'm not a fan of patching original sources if not realy needed, but this patch doesn't harm and has even a small benefit, so i can live with it beeing ported to MySQL 5.[67]


What exact will you symlink from where to where? We have /usr/local/etc/mysql/my.cnf{,.sample} in pkg-plist now, so there might be potential to conflicts. If we consider symlinks then they should be good tested ;)
IMHO there is absolutly no need for symlinks.
Comment 33 Markus Kohlmeyer 2016-05-17 13:42:34 UTC
(In reply to Markus Kohlmeyer from comment #29)
s/search patch/search path/
Comment 34 Mahdi Mokhtari freebsd_committer freebsd_triage 2016-05-17 13:55:14 UTC
(In reply to Markus Kohlmeyer from comment #33)
I know what 'patch-mysys_my__default.c' is doing, and as i said i even see no problem with it ;D.

I just wanna make sure thing are/will stay more organized.

if you look at thread from first to end, you'll see what i mean to do.
This thread is started to fix the error for starting mysql-server service (that was caused by that permission typo).
Then topic of discussion was changed to `/usr/local/etc/mysql/my.cnf vs /usr/local/etc/my.cnf` and then continued to fix `/etc/my.cnf` which is wrong according to hier(7), and finally we have a patch that bundles all changes and warns to all users who upgrades their package "Hey things have been changed".

please note that many ppl that are using FreeBSD for production does not expect such huge changes in such small time (and we've discussed it before)

And also i suggest when we fixed a problem for this issue/PR leave it to be committed, and follow up other discussions in their specific issues/PR (it's a good habit i learned from bug triaging :D).
Comment 35 Mahdi Mokhtari freebsd_committer freebsd_triage 2016-05-17 14:00:55 UTC
(In reply to Mahdi Mokhtari from comment #34)
So i suggest (to practically make things more organised ;D) we let the patch that we all agree on that be committed, and in meanwhile we can do ours in other Issue (#209579)
Comment 36 Mahdi Mokhtari freebsd_committer freebsd_triage 2016-05-17 14:16:08 UTC
(In reply to Markus Kohlmeyer from comment #36)
I appreciate ;)
Comment 37 commit-hook freebsd_committer 2016-05-17 18:33:52 UTC
A commit references this bug:

Author: pi
Date: Tue May 17 18:33:05 UTC 2016
New revision: 415407
URL: https://svnweb.freebsd.org/changeset/ports/415407

Log:
  databases/mysql57-server: fix the perms of my.cnf to 0644

  PR:		209512
  Reported by:	Regulus Kean <rkean@bitmessage.ch>
  Submitted by:	Markus Kohlmeyer <rootservice@gmail.com>
  Approved by:	Mahdi Mokhtari <mokhi64@gmail.com> (maintainer)

Changes:
  head/databases/mysql57-server/Makefile
  head/databases/mysql57-server/pkg-plist
Comment 38 Kurt Jaeger freebsd_committer 2016-05-17 18:34:17 UTC
Committed, thanks.
Comment 39 Mahdi Mokhtari freebsd_committer freebsd_triage 2016-05-17 20:04:40 UTC
Thanks guys :D
Good job ;)
Comment 40 Ron Wingfield 2016-05-23 16:48:30 UTC
Gentlemen:  As of SAT 21 MAY 2016 following an upgrade to mysql57-server-5.7.12 on FreeBSD v10.2, the system continues failing to start.  I have read this thread, top to bottom, and applied the "temporary fix" suggested at <a href="https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209512#c7">

   /usr/local/etc/mysql # chown root:wheel my.cnf
   /usr/local/etc/mysql # chmod 644 my.cnf

. . .didn’t help, same problem.

On a whim, I applied the permissions as follows:

   /usr/local/etc/mysql # chmod 777 my.cnf

. . .now  service mysql-server start works, but the permissions are of concern.



Obviously this port upgrade was not ready for release.  What permissions would you suggest to correct the situation?  

FYI, the following diagnostic information, re: mode 644:
<blockquote>
2016-05-23T16:35:03.6NZ mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
2016-05-23T16:35:03.762409Z 0 [Warning] Could not increase number of max_open_files to more than 13914 (request: 32929)
2016-05-23T16:35:03.762636Z 0 [Warning] Changed limits: table_open_cache: 6876 (requested 16384)
2016-05-23T16:35:04.140700Z 0 [Note] /usr/local/libexec/mysqld (mysqld 5.7.12-log) starting as process 14540 ...
2016-05-23T16:35:04.215395Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-05-23T16:35:04.215505Z 0 [Note] InnoDB: Uses event mutexes
2016-05-23T16:35:04.215526Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2016-05-23T16:35:04.215544Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2016-05-23T16:35:04.216283Z 0 [Note] InnoDB: Number of pools: 1
2016-05-23T16:35:04.216562Z 0 [Note] InnoDB: Not using CPU crc32 instructions
2016-05-23T16:35:04.262057Z 0 [Note] InnoDB: Initializing buffer pool, total size = 1G, instances = 8, chunk size = 128M
2016-05-23T16:35:04.410788Z 0 [ERROR] InnoDB: mmap(136151040 bytes) failed; errno 12
2016-05-23T16:35:04.462016Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2016-05-23T16:35:04.462115Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2016-05-23T16:35:04.462167Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2016-05-23T16:35:04.462193Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2016-05-23T16:35:04.462212Z 0 [ERROR] Failed to initialize plugins.
2016-05-23T16:35:04.462228Z 0 [ERROR] Aborting

2016-05-23T16:35:04.462250Z 0 [Note] Binlog end
2016-05-23T16:35:04.462396Z 0 [Note] Shutting down plugin 'CSV'
2016-05-23T16:35:04.467973Z 0 [Note] /usr/local/libexec/mysqld: Shutdown complete
</blockquote>
Comment 41 Ron Wingfield 2016-05-23 16:49:41 UTC
Gentlemen:  As of SAT 21 MAY 2016 following an upgrade of mysql57-server-5.7.12 on FreeBSD v10.2, the system continues failing to start.  I have read this thread, top to bottom, and applied the "temporary fix" suggested at <a href="https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209512#c7">

   /usr/local/etc/mysql # chown root:wheel my.cnf
   /usr/local/etc/mysql # chmod 644 my.cnf

. . .didn’t help, same problem.

On a whim, I applied the permissions as follows:

   /usr/local/etc/mysql # chmod 777 my.cnf

. . .now  service mysql-server start works, but the permissions are of concern.


Obviously this port upgrade was not ready for release.  What permissions would you suggest to correct the situation?
Comment 42 Mahdi Mokhtari freebsd_committer freebsd_triage 2016-05-23 17:46:36 UTC
(In reply to Ron Wingfield from comment #41)
I checked an upgrade procedure for reproducing your problem, but everything works good for me.
Can you please specify more things ?
Comment 43 Ron Wingfield 2016-05-23 17:58:27 UTC
(In reply to Mahdi Mokhtari from comment #42)

These permissions regarding /usr/local/etc/mysql/my.cnf
(see https://forums.freebsd.org/threads/56275/#post-320552)
. . .produce the following results:

mode
777   starts
770   fail
774   fail
775   fail
776   starts
746   starts
646   starts
644   fail

FYI, here is the cascade of errors resulting from the "world/other" users not having write permission. . . .not good!

2016-05-23T17:34:17.6NZ mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
2016-05-23T17:34:17.936824Z 0 [Warning] Could not increase number of max_open_files to more than 13914 (request: 32929)
2016-05-23T17:34:17.937062Z 0 [Warning] Changed limits: table_open_cache: 6876 (requested 16384)
2016-05-23T17:34:18.312719Z 0 [Note] /usr/local/libexec/mysqld (mysqld 5.7.12-log) starting as process 19368 ...
2016-05-23T17:34:18.387387Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-05-23T17:34:18.387491Z 0 [Note] InnoDB: Uses event mutexes
2016-05-23T17:34:18.387512Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2016-05-23T17:34:18.387530Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2016-05-23T17:34:18.388281Z 0 [Note] InnoDB: Number of pools: 1
2016-05-23T17:34:18.388566Z 0 [Note] InnoDB: Not using CPU crc32 instructions
2016-05-23T17:34:18.434279Z 0 [Note] InnoDB: Initializing buffer pool, total size = 1G, instances = 8, chunk size = 128M
2016-05-23T17:34:18.583425Z 0 [ERROR] InnoDB: mmap(136151040 bytes) failed; errno 12
2016-05-23T17:34:18.634733Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2016-05-23T17:34:18.634832Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2016-05-23T17:34:18.634884Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2016-05-23T17:34:18.634902Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2016-05-23T17:34:18.634921Z 0 [ERROR] Failed to initialize plugins.
2016-05-23T17:34:18.634944Z 0 [ERROR] Aborting

2016-05-23T17:34:18.634965Z 0 [Note] Binlog end
2016-05-23T17:34:18.635111Z 0 [Note] Shutting down plugin 'CSV'
2016-05-23T17:34:18.640823Z 0 [Note] /usr/local/libexec/mysqld: Shutdown complete

2016-05-23T17:34:18.6NZ mysqld_safe mysqld from pid file /var/db/mysql/bravo.archaxis.net.pid ended
Comment 44 Ron Wingfield 2016-05-23 18:21:40 UTC
Also, once started, an attempt to check the version, i.e., mysql -v, results with the follow warning and error:

 # mysql -v
mysql: [Warning] World-writable config file '/usr/local/etc/mysql/my.cnf' is ignored.
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

. . .and two previously working applications, phpMyAdmin and ZenPhoto, now are broken.
Comment 45 Ron Wingfield 2016-05-23 18:40:23 UTC
I just remembered that I should run mysql_upgrade once the server is started -- not having previously been able to start the server, obviously that could not be done. I have learned that I can login to the serer by executing "# mysql -u root -p" The password is prompted,  and after entering, the session is ready.

After exiting, and attempting to run "# mysql_upgrade", the following:

mysql_upgrade: [Warning] World-writable config file '/usr/local/etc/mysql/my.cnf' is ignored.
mysql_upgrade: Got error: 1045: Access denied for user 'root'@'localhost' (using password: NO) while connecting to the MySQL server
Upgrade process encountered error and will not continue.


. . .very frustrating.
Comment 46 Markus Kohlmeyer 2016-05-23 18:50:38 UTC
The fix in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209512#c7 is correct. You're running into same other problem, so lets take a look at the full startup log by temporary removing ">/dev/null 2>/dev/null" from line 60 in /usr/local/etc/rc.d/mysql-server and then post the full onscreen output of `service mysql-service start`. Afterwards please readd the ">/dev/null 2>/dev/null".

Also please provide:
ls -alh /var/db/mysql* /usr/local/etc/mysql



As reference my system:

[root@devgate:~] # ls -alh /var/db/mysql* /usr/local/etc/mysql
/usr/local/etc/mysql:
total 20
drwxr-xr-x   3 root   wheel   512B May 17 21:20 ./
drwxr-xr-x  25 root   wheel   1.5K May 21 11:48 ../
drwxr-x---   2 mysql  mysql   512B May 17 21:19 keyring/
-rw-r--r--   1 root   wheel   3.0K Apr 25 02:10 my.cnf
-rw-r--r--   1 root   wheel   2.3K May 17 21:19 my.cnf.sample

/var/db/mysql:
total 8
drwxr-xr-x   2 mysql  mysql   512B Mar 19 03:33 ./
drwxr-xr-x  16 root   wheel   512B May 21 11:49 ../

/var/db/mysql_secure:
total 8
drwxr-x---   2 mysql  mysql   512B May 17 21:19 ./
drwxr-xr-x  16 root   wheel   512B May 21 11:49 ../

/var/db/mysql_tmpdir:
total 8
drwxr-x---   2 mysql  mysql   512B May 17 21:19 ./
drwxr-xr-x  16 root   wheel   512B May 21 11:49 ../
[root@devgate:~] # mysql -v
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 47567
Server version: 5.7.12-log Source distribution

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Reading history-file /root/.mysql_history
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

root@127.0.0.1 [(none)]> quit;
Writing history-file /root/.mysql_history
Bye
[root@devgate:~] #
Comment 47 Ron Wingfield 2016-05-23 19:32:19 UTC
With apologies, attempting to run "# mysql_upgrade -u root -p"   did allow the userid password to be accepted.  . . .well, I didn't know.  

. . .issued the messages, 

   Upgrade process completed successfully.
   Checking if update is needed.
 

Still, the "issue" of the permissions for the my.cnf file is unresolved.

(In reply to Markus Kohlmeyer from comment #46)

Actually already done:  . . .temporary removing ">/dev/null 2>/dev/null" from line 60 in /usr/local/etc/rc.d/mysql-server and then post the full onscreen output of `service mysql-service start`.


 Afterwards please readd the ">/dev/null 2>/dev/null".  --- Already posted at https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209512#c40

Here are the output lists requested:

 # ls -alh /var/db/mysql* /usr/local/etc/mysql
/usr/local/etc/mysql:
total 20
drwxr-xr-x   3 root   wheel   512B May 21 18:40 .
drwxr-xr-x  48 root   wheel   2.0K May 21 18:40 ..
drwxr-x---   2 mysql  mysql   512B May 21 18:36 keyring
-rw-r--rw-   1 root   wheel   2.4K May 23 12:13 my.cnf
-rw-r-----   1 root   wheel   2.3K May 21 18:36 my.cnf.sample

/var/db/mysql:
total 189056
drwxr-xr-x  14 mysql  mysql     1.5K May 23 14:05 .
drwxr-xr-x  22 root   wheel     1.0K May 23 13:27 ..
drwx------   2 mysql  mysql     4.0K Jan  6 13:14 CAP_Forums
-rw-r--r--   1 root   mysql     1.9M Jun 19  2015 CAP_Forums.gz
drwx------   2 mysql  mysql     9.0K Jan  6 13:14 CAP_Store_AR042
-rw-r--r--   1 root   mysql     205K Sep 12  2011 CAP_Store_AR042.tar.gz
drwx------   2 mysql  mysql     8.5K Jan  6 13:14 CAP_Store_XX042
drwx------   2 mysql  mysql     512B Mar  6  2011 JUD
-rw-r--r--   1 root   mysql     125K Jun 19  2015 JUD.gz
-rw-r--r--   1 root   mysql      12K Jul  1  2015 SHOW
drwx------   2 mysql  mysql     7.5K Aug 25  2015 SMF
drwx------   2 mysql  mysql     2.0K Aug 30  2010 WebCalendar
-rw-r--r--   1 root   mysql     3.5M Jun 19  2015 WebCalendar.gz
-rw-r--r--   1 root   mysql      13M Jun 25  2015 ZenPhoto.gz
-rw-rw----   1 mysql  mysql      87K Sep 18  2011 archaxis.net.err
-rw-rw----   1 mysql  mysql      56B Jun 19  2015 auto.cnf
-rw-r--r--   1 root   mysql       0B May 13 10:50 available_drivers
-rw-rw----   1 mysql  mysql     525K May 23 14:06 bravo.archaxis.net.err
-rw-r-----   1 mysql  mysql       6B May 23 14:05 bravo.archaxis.net.pid
-rw-------   1 mysql  mysql     1.6K May 23 11:15 ca-key.pem
-rw-r--r--   1 mysql  mysql     1.0K May 23 11:15 ca.pem
-rw-r--r--   1 mysql  mysql     1.1K May 23 11:15 client-cert.pem
-rw-------   1 mysql  mysql     1.6K May 23 11:15 client-key.pem
-rw-r-----   1 mysql  mysql     1.5K May 23 14:05 ib_buffer_pool
-rw-r-----   1 mysql  mysql      48M May 23 14:05 ib_logfile0
-rw-r-----   1 mysql  mysql      48M Dec 30 19:42 ib_logfile1
-rw-rw----   1 mysql  mysql      18M May 23 14:05 ibdata1
-rw-r-----   1 mysql  mysql      12M May 23 14:06 ibtmp1
drwxrwxrwx   2 mysql  jabberd   1.0K Mar  7  2011 jabberd2
-rw-r--r--   1 root   mysql     1.8M Jun 19  2015 jabberd2.gz
drwx------   2 mysql  mysql     2.5K May 23 13:57 mysql
-rw-rw----   1 mysql  mysql     126B Mar  3  2011 mysql-bin.000001
-rw-rw----   1 mysql  mysql     126B Mar  3  2011 mysql-bin.000002
-rw-rw----   1 mysql  mysql     1.4M Mar 15  2011 mysql-bin.000003
-rw-rw----   1 mysql  mysql      49K Mar 17  2011 mysql-bin.000004
-rw-rw----   1 mysql  mysql      84K Mar 20  2011 mysql-bin.000005
-rw-rw----   1 mysql  mysql     9.8M Jun 28  2011 mysql-bin.000006
-rw-rw----   1 mysql  mysql     126B Jun 28  2011 mysql-bin.000007
-rw-rw----   1 mysql  mysql     126B Jun 28  2011 mysql-bin.000008
-rw-rw----   1 mysql  mysql     126B Jun 28  2011 mysql-bin.000009
-rw-rw----   1 mysql  mysql     888K Jul 13  2011 mysql-bin.000010
-rw-rw----   1 mysql  mysql     126B Jul 13  2011 mysql-bin.000011
-rw-rw----   1 mysql  mysql     126B Jul 13  2011 mysql-bin.000012
-rw-rw----   1 mysql  mysql     126B Jul 15  2011 mysql-bin.000013
-rw-rw----   1 mysql  mysql      46K Jul 15  2011 mysql-bin.000014
-rw-rw----   1 mysql  mysql      25M Sep 18  2011 mysql-bin.000015
-rw-rw----   1 mysql  mysql     285B Jul 15  2011 mysql-bin.index
-rw-r--r--   1 root   mysql       6B May 23 13:57 mysql_upgrade_info
-rw-rw----   1 mysql  mysql       0B May 23 14:05 mysqld_safe.pid
drwxr-x---   2 mysql  mysql     4.0K May 23 13:57 performance_schema
drwx------   2 mysql  mysql     1.5K Dec 29 10:10 phpmyadmin
-rw-------   1 mysql  mysql     1.6K May 23 11:15 private_key.pem
-rw-r--r--   1 mysql  mysql     452B May 23 11:15 public_key.pem
-rw-r--r--   1 mysql  mysql     1.1K May 23 11:15 server-cert.pem
-rw-------   1 mysql  mysql     1.6K May 23 11:15 server-key.pem
drwxr-x---   2 mysql  mysql     4.5K Jan  6 13:14 sys
drwxr-x---   2 mysql  mysql     1.0K May 11 13:04 zenphoto

/var/db/mysql.bu:
total 188720
drwxr-xr-x  14 mysql  mysql     1.5K May 13 10:51 .
drwxr-xr-x  22 root   wheel     1.0K May 23 13:27 ..
drwx------   2 mysql  mysql     4.0K Jan  6 13:14 CAP_Forums
-rw-r--r--   1 root   mysql     1.9M Jun 19  2015 CAP_Forums.gz
drwx------   2 mysql  mysql     9.0K Jan  6 13:14 CAP_Store_AR042
-rw-r--r--   1 root   mysql     205K Sep 12  2011 CAP_Store_AR042.tar.gz
drwx------   2 mysql  mysql     8.5K Jan  6 13:14 CAP_Store_XX042
drwx------   2 mysql  mysql     512B Mar  6  2011 JUD
-rw-r--r--   1 root   mysql     125K Jun 19  2015 JUD.gz
-rw-r--r--   1 root   mysql      12K Jul  1  2015 SHOW
drwx------   2 mysql  mysql     7.0K Aug 25  2015 SMF
drwx------   2 mysql  mysql     2.0K Aug 30  2010 WebCalendar
-rw-r--r--   1 root   mysql     3.5M Jun 19  2015 WebCalendar.gz
-rw-r--r--   1 root   mysql      13M Jun 25  2015 ZenPhoto.gz
-rw-rw----   1 mysql  mysql      87K Sep 18  2011 archaxis.net.err
-rw-rw----   1 mysql  mysql      56B Jun 19  2015 auto.cnf
-rw-r--r--   1 root   mysql       0B May 13 10:50 available_drivers
-rw-rw----   1 mysql  mysql     203K May 11 13:16 bravo.archaxis.net.err
-rw-r-----   1 mysql  mysql       4B Feb  1 17:32 bravo.archaxis.net.pid
-rw-r-----   1 mysql  mysql     2.8K Feb  1 17:31 ib_buffer_pool
-rw-r-----   1 mysql  mysql      48M May 13 22:07 ib_logfile0
-rw-r-----   1 mysql  mysql      48M Dec 30 19:42 ib_logfile1
-rw-rw----   1 mysql  mysql      18M May 13 22:07 ibdata1
-rw-r-----   1 mysql  mysql      12M May 13 22:07 ibtmp1
drwxrwxrwx   2 mysql  jabberd   1.0K Mar  7  2011 jabberd2
-rw-r--r--   1 root   mysql     1.8M Jun 19  2015 jabberd2.gz
drwx------   2 mysql  mysql     2.0K Jan  6 13:14 mysql
-rw-rw----   1 mysql  mysql     126B Mar  3  2011 mysql-bin.000001
-rw-rw----   1 mysql  mysql     126B Mar  3  2011 mysql-bin.000002
-rw-rw----   1 mysql  mysql     1.4M Mar 15  2011 mysql-bin.000003
-rw-rw----   1 mysql  mysql      49K Mar 17  2011 mysql-bin.000004
-rw-rw----   1 mysql  mysql      84K Mar 20  2011 mysql-bin.000005
-rw-rw----   1 mysql  mysql     9.8M Jun 28  2011 mysql-bin.000006
-rw-rw----   1 mysql  mysql     126B Jun 28  2011 mysql-bin.000007
-rw-rw----   1 mysql  mysql     126B Jun 28  2011 mysql-bin.000008
-rw-rw----   1 mysql  mysql     126B Jun 28  2011 mysql-bin.000009
-rw-rw----   1 mysql  mysql     888K Jul 13  2011 mysql-bin.000010
-rw-rw----   1 mysql  mysql     126B Jul 13  2011 mysql-bin.000011
-rw-rw----   1 mysql  mysql     126B Jul 13  2011 mysql-bin.000012
-rw-rw----   1 mysql  mysql     126B Jul 15  2011 mysql-bin.000013
-rw-rw----   1 mysql  mysql      46K Jul 15  2011 mysql-bin.000014
-rw-rw----   1 mysql  mysql      25M Sep 18  2011 mysql-bin.000015
-rw-rw----   1 mysql  mysql     285B Jul 15  2011 mysql-bin.index
-rw-r--r--   1 root   mysql       6B Jan  6 13:14 mysql_upgrade_info
-rw-rw----   1 mysql  mysql       0B Feb  1 17:32 mysqld_safe.pid
drwxr-x---   2 mysql  mysql     4.0K Jan  6 13:14 performance_schema
drwx------   2 mysql  mysql     1.5K Dec 29 10:10 phpmyadmin
drwxr-x---   2 mysql  mysql     4.5K Jan  6 13:14 sys
drwxr-x---   2 mysql  mysql     1.0K May 11 13:04 zenphoto

/var/db/mysql_secure:
total 4
drwxr-x---   2 mysql  mysql   512B May 21 18:36 .
drwxr-xr-x  22 root   wheel   1.0K May 23 13:27 ..

/var/db/mysql_tmpdir:
total 4
drwxr-x---   2 mysql  mysql   512B May 23 12:34 .
drwxr-xr-x  22 root   wheel   1.0K May 23 13:27 ..
Comment 48 Markus Kohlmeyer 2016-05-23 20:09:59 UTC
Have you moved your my.cnf to /usr/local/etc/mysql/my.cnf ?
If not, then do it please and chmod it 0644
If you don't have one, then you should remove /usr/local/etc/mysql/my.cnf temporary, start mysql, mysqldump(!!!) all databases (not phpmyadmin!!!), stop mysql, `rm -r /var/db/mysql/*`, copy /usr/local/etc/mysql/my.cnf.sample to /usr/local/etc/mysql/my.cnf, fit /usr/local/etc/mysql/my.cnf to your needs, start mysql, import backup created with mysqldump.

Please keep in mind that /usr/local/etc/mysql/my.cnf.sample sets lower_case_table_names by default, which might be problematic with your uppercase tablenames (never do that again!).

What are all the *.gz in /var/db/mysql from?


Anything else is well documented at https://dev.mysql.com/doc/refman/5.7/en/ and not subject to be explained here at the bugtracker.
Comment 49 Ron Wingfield 2016-05-23 21:05:13 UTC
(In reply to Markus Kohlmeyer from comment #48)
RE:  "Have you moved your my.cnf to /usr/local/etc/mysql/my.cnf ?"   -- Yes . . .early on.

RE:  ". . .chmod [to] 0644"   -- As previously mentioned, without 646, the server will not start!

RE:  "What are all the *.gz in /var/db/mysql from?" -- . . .I know, I know, should be in different directory . . .just hasty backups.  I'll move them elsewhere.

Finally, RE:  "Please keep in mind that /usr/local/etc/mysql/my.cnf.sample sets lower_case_table_names by default, which might be problematic with your uppercase tablenames (never do that again!)."  -- Upper case characters never been a problem before.   Funny, I tend not to use Upper case characters in SQL statements, e.g., "show databases" rather than "SHOW DATABASES".  I'm an old c/Unix programmer . . .always aware of case sensitivity.  (I've also punched COBOL and OS/360 JCL on 029 card punches . . .if you want to talk old.)

Regardless, back to this "issue" of mode 644 for the /usr/local/etc/mysql/my.cnf file.  In my installation, unless mode 646, the server fails to start.   

And finally, RE:  "Anything else is well documented at https://dev.mysql.com/doc/refman/5.7/en/ and not subject to be explained here at the bugtracker."  -- I realize and appreciate that.  NOT asking you guys to help with that -- Once the server is running, then I can deal with that.  (There's probably simply a path that needs to be corrected in phpMyAdmin and the ZenPhoto CMS configs.   . . .just annoying that this upgrade broke them without warning.  Just mentioned as FYI examples of other things broken.)  Especially that the "heads-up" regarding the relocation of my.cnf is NOT mentioned in /usr/ports/UPDATING!

I have to insist that the upper/lower case spellings, etc., have nothing to do with the 644 vs 646 permissions for my.cnf.  

So (in my case) why does the "other world" need write permission?

Also, BTW, thanks to you and the others for your help!
Comment 50 Markus Kohlmeyer 2016-05-23 22:13:58 UTC
The entry for UPDATING is waiting to be committed, sorry.

> As previously mentioned, without 646, the server will not start!

It will, trust me.

OK, just to help you on this:

# stop mysql
service mysql-server stop
# just to be safe
chown -R mysql:mysql /var/db/mysql*
# temporary remove new default my.cnf
rm /usr/local/etc/mysql/my.cnf
# backup your old my.cnf and move it to /usr/local/etc/mysql/my.cnf
mv /path/to/your/my.cnf /usr/local/etc/mysql/my.cnf
chmod 0644 /usr/local/etc/mysql/my.cnf
chown root:wheel /usr/local/etc/mysql/my.cnf
# start mysql
service mysql-server start
# create a full backup
mysqldump --flush-logs --master-data=2 --lock-all-tables --delete-master-logs --allow-keywords --complete-insert --triggers --routines --events --order-by-primary --set-gtid-purged=OFF --tz-utc --hex-blob --all-databases -uroot -p > /tmp/mysqldump.sql
# remove all DB-files
rm -r /var/db/mysql/*
# merge your old and the new my.cnf.sample to fit your needs
service mysql-server start
# restore full backup
mysql -uroot -p < /tmp/mysqldump.sql
# up and running again


Hope that helps. If not, you can contact me by mail and i can have a look directly to your system in the next two hours or tommorow afternoon (UTC +0200).
Comment 51 Daniel Maslowski 2016-12-19 00:54:51 UTC
I still had this issue on FreeBSD 11 with mysql57-server-5.7.15 installed through pkg. I couldn't start mysql-server for the first time and hadn't set it up yet. To solve this, I changed the permissions to 646, as Ron suggested, started the daemon, ran the mysql_secure_installation tool (which raised a warning about the permissions), dropped back to 644, and restarted. That worked. :)
Comment 52 Daniel Maslowski 2016-12-19 01:05:18 UTC
(In reply to Daniel Maslowski from comment #51)

My bad. Restarting the daemon gave no error, so I assumed it was fine. But then it wasn't running. I still have to keep the permissions to 646. :/
Comment 53 Markus Kohlmeyer 2016-12-24 01:07:02 UTC
(In reply to Daniel Maslowski from comment #52)

I realy can't reproduce that behaviour on my FreeBSD 10.3 or 11.0 systems, not even on a quick newly installed system in virtualbox.
That said, i can't help fixing this issue, as i can't reproduce it.
Sorry.


Maybe there is something installed/running on your system that triggers this issue, some tools, some scripts, jails, virtual environments, bad hardware, or possibly you're using zfs (i don't trust zfs as it has too many bugs and quirks). Maybe not.


As i alrady said earlier in comment #7 my.cnf must have 0644/root/wheel
Also absolutly no user ever needs or should have write access to my.cnf, never.


As a reference here is step-by-step what i did:



[root@devnoip:~] # freebsd-version
10.3-STABLE
[root@devnoip:~] # pkg install mysql57-server
Updating FreeBSD repository catalogue...
Fetching meta.txz: 100%    944 B   0.9kB/s    00:01
Fetching packagesite.txz: 100%    6 MiB   2.0MB/s    00:03
Processing entries: 100%
FreeBSD repository update completed. 25786 packages processed.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        mysql57-server: 5.7.15_1
        mysql57-client: 5.7.15

Number of packages to be installed: 2

The process will require 190 MiB more space.
15 MiB to be downloaded.

Proceed with this action? [y/N]: y
Fetching mysql57-server-5.7.15_1.txz: 100%   13 MiB   3.5MB/s    00:04
Fetching mysql57-client-5.7.15.txz: 100%    2 MiB   1.9MB/s    00:01
Checking integrity... done (0 conflicting)
[1/2] Installing mysql57-client-5.7.15...
[1/2] Extracting mysql57-client-5.7.15: 100%
[2/2] Installing mysql57-server-5.7.15_1...
===> Creating groups.
Using existing group 'mysql'.
===> Creating users
Using existing user 'mysql'.
[2/2] Extracting mysql57-server-5.7.15_1: 100%
Message from mysql57-client-5.7.15:
* * * * * * * * * * * * * * * * * * * * * * * *

This is the mysql CLIENT without the server.
for complete server and client, please install databases/mysql57-server

* * * * * * * * * * * * * * * * * * * * * * * *
Message from mysql57-server-5.7.15_1:
*****************************************************************************

Remember to run mysql_upgrade the first time you start the MySQL server
after an upgrade from an earlier version.

Initial password for first time use of MySQL is saved in $HOME/.mysql_secret
ie. when you want to use "mysql -u root -p" first you should see password
in /root/.mysql_secret

*****************************************************************************

*****************************************************************************

The default location for my.cnf has changed from "/var/db/mysql/my.cnf" to
"/usr/local/etc/mysql/my.cnf". Existing my.cnf files must be merged manually
with the new default and moved to the new location. To continue using the
my.cnf file at the old location, set "mysql_optfile" in /etc/rc.conf to
point to the location of the existing my.cnf file.

*****************************************************************************
[root@devnoip:~] # ls -alh /var/db/mysql*
/var/db/mysql:
total 8
drwxr-xr-x   2 mysql  mysql   512B Dec 24 01:14 ./
drwxr-xr-x  18 root   wheel   512B Dec 24 01:14 ../

/var/db/mysql_secure:
total 8
drwxr-x---   2 mysql  mysql   512B Dec 22 06:04 ./
drwxr-xr-x  18 root   wheel   512B Dec 24 01:14 ../

/var/db/mysql_tmpdir:
total 8
drwxr-x---   2 mysql  mysql   512B Dec 22 06:04 ./
drwxr-xr-x  18 root   wheel   512B Dec 24 01:14 ../
[root@devnoip:~] # ls -alh /usr/local/etc/mysql/
total 20
drwxr-xr-x   3 root   wheel   512B Dec 24 01:14 ./
drwxr-xr-x  24 root   wheel   1.5K Dec 24 01:14 ../
drwxr-x---   2 mysql  mysql   512B Dec 22 06:04 keyring/
-rw-r--r--   1 root   wheel   2.3K Dec 22 06:04 my.cnf
-rw-r--r--   1 root   wheel   2.3K Dec 22 06:04 my.cnf.sample
[root@devnoip:~] # service mysql-server start
2016-12-24 01:19:08 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize
2016-12-24 01:19:18 [WARNING] The bootstrap log isn't empty:
2016-12-24 01:19:18 [WARNING] 2016-12-24T00:19:08.427517Z 0 [Warning] --bootstrap is deprecated. Please consider using --initialize instead

Starting mysql.
[root@devnoip:~] # ls -alh /var/db/mysql*
/var/db/mysql:
total 786872
drwxr-xr-x   5 mysql  mysql   1.0K Dec 24 01:19 ./
drwxr-xr-x  18 root   wheel   512B Dec 24 01:14 ../
-rw-r-----   1 mysql  mysql    56B Dec 24 01:19 auto.cnf
-rw-------   1 mysql  mysql   1.6K Dec 24 01:19 ca-key.pem
-rw-r--r--   1 mysql  mysql   1.0K Dec 24 01:19 ca.pem
-rw-r--r--   1 mysql  mysql   1.1K Dec 24 01:19 client-cert.pem
-rw-------   1 mysql  mysql   1.6K Dec 24 01:19 client-key.pem
-rw-r-----   1 mysql  mysql   346B Dec 24 01:19 devnoip-slow.log
-rw-r-----   1 mysql  mysql   2.9K Dec 24 01:19 devnoip.rootservice.org.err
-rw-r-----   1 mysql  mysql     6B Dec 24 01:19 devnoip.rootservice.org.pid
-rw-r-----   1 mysql  mysql   412B Dec 24 01:19 ib_buffer_pool
-rw-r-----   1 mysql  mysql   256M Dec 24 01:19 ib_logfile0
-rw-r-----   1 mysql  mysql   256M Dec 24 01:19 ib_logfile1
-rw-r-----   1 mysql  mysql   128M Dec 24 01:19 ibdata1
-rw-r-----   1 mysql  mysql   128M Dec 24 01:19 ibtmp1
drwxr-x---   2 mysql  mysql   2.0K Dec 24 01:19 mysql/
-rw-r-----   1 mysql  mysql    96K Dec 24 01:19 mysql-bin.000001
-rw-r-----   1 mysql  mysql   194B Dec 24 01:19 mysql-bin.000002
-rw-r-----   1 mysql  mysql    38B Dec 24 01:19 mysql-bin.index
-rw-rw----   1 mysql  mysql     0B Dec 24 01:19 mysqld_safe.pid
drwxr-x---   2 mysql  mysql   4.0K Dec 24 01:19 performance_schema/
-rw-------   1 mysql  mysql   1.6K Dec 24 01:19 private_key.pem
-rw-r--r--   1 mysql  mysql   452B Dec 24 01:19 public_key.pem
-rw-r--r--   1 mysql  mysql   1.1K Dec 24 01:19 server-cert.pem
-rw-------   1 mysql  mysql   1.6K Dec 24 01:19 server-key.pem
drwxr-x---   2 mysql  mysql   4.5K Dec 24 01:19 sys/

/var/db/mysql_secure:
total 8
drwxr-x---   2 mysql  mysql   512B Dec 22 06:04 ./
drwxr-xr-x  18 root   wheel   512B Dec 24 01:14 ../

/var/db/mysql_tmpdir:
total 8
drwxr-x---   2 mysql  mysql   512B Dec 24 01:19 ./
drwxr-xr-x  18 root   wheel   512B Dec 24 01:14 ../
[root@devnoip:~] # ls -alh /usr/local/etc/mysql/
total 20
drwxr-xr-x   3 root   wheel   512B Dec 24 01:14 ./
drwxr-xr-x  24 root   wheel   1.5K Dec 24 01:14 ../
drwxr-x---   2 mysql  mysql   512B Dec 22 06:04 keyring/
-rw-r--r--   1 root   wheel   2.3K Dec 22 06:04 my.cnf
-rw-r--r--   1 root   wheel   2.3K Dec 22 06:04 my.cnf.sample
[root@devnoip:~] # cat /var/db/mysql/devnoip.rootservice.org.err
2016-12-24T00:19:18.6NZ mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
2016-12-24T00:19:18.935520Z 0 [Note] /usr/local/libexec/mysqld (mysqld 5.7.15-log) starting as process 85660 ...
2016-12-24T00:19:18.975875Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-12-24T00:19:18.975923Z 0 [Note] InnoDB: Uses event mutexes
2016-12-24T00:19:18.975935Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2016-12-24T00:19:18.975945Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2016-12-24T00:19:18.976425Z 0 [Note] InnoDB: Number of pools: 1
2016-12-24T00:19:18.976579Z 0 [Note] InnoDB: Using CPU crc32 instructions
2016-12-24T00:19:18.978589Z 0 [Note] InnoDB: Initializing buffer pool, total size = 1G, instances = 8, chunk size = 128M
2016-12-24T00:19:19.185865Z 0 [Note] InnoDB: Completed initialization of buffer pool
2016-12-24T00:19:19.242391Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2016-12-24T00:19:19.369971Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2016-12-24T00:19:19.370106Z 0 [Note] InnoDB: Setting file '/var/db/mysql/ibtmp1' size to 128 MB. Physically writing the file full; Please wait ...
2016-12-24T00:19:19.370833Z 0 [Note] InnoDB: Progress in MB:
 100
2016-12-24T00:19:20.178555Z 0 [Note] InnoDB: File '/var/db/mysql/ibtmp1' size is now 128 MB.
2016-12-24T00:19:20.179934Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2016-12-24T00:19:20.179975Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2016-12-24T00:19:20.180281Z 0 [Note] InnoDB: Waiting for purge to start
2016-12-24T00:19:20.233776Z 0 [Note] InnoDB: 5.7.15 started; log sequence number 2530035
2016-12-24T00:19:20.233971Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/db/mysql/ib_buffer_pool
2016-12-24T00:19:20.234385Z 0 [Note] Plugin 'FEDERATED' is disabled.
2016-12-24T00:19:20.323531Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2016-12-24T00:19:20.323552Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2016-12-24T00:19:20.324579Z 0 [Warning] CA certificate ca.pem is self signed.
2016-12-24T00:19:20.324656Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2016-12-24T00:19:20.324832Z 0 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
2016-12-24T00:19:20.324869Z 0 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
2016-12-24T00:19:20.324904Z 0 [Note] Server socket created on IP: '127.0.0.1'.
2016-12-24T00:19:20.443746Z 0 [Note] Event Scheduler: Loaded 0 events
2016-12-24T00:19:20.443937Z 0 [Note] /usr/local/libexec/mysqld: ready for connections.
Version: '5.7.15-log'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
2016-12-24T00:19:20.496890Z 0 [Note] InnoDB: Buffer pool(s) load completed at 161224  1:19:20
[root@devnoip:~] # service mysql-server restart
Stopping mysql.
Waiting for PIDS: 85660.
Starting mysql.
[root@devnoip:~] # cat /var/db/mysql/devnoip.rootservice.org.err
2016-12-24T00:19:18.6NZ mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
2016-12-24T00:19:18.935520Z 0 [Note] /usr/local/libexec/mysqld (mysqld 5.7.15-log) starting as process 85660 ...
2016-12-24T00:19:18.975875Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-12-24T00:19:18.975923Z 0 [Note] InnoDB: Uses event mutexes
2016-12-24T00:19:18.975935Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2016-12-24T00:19:18.975945Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2016-12-24T00:19:18.976425Z 0 [Note] InnoDB: Number of pools: 1
2016-12-24T00:19:18.976579Z 0 [Note] InnoDB: Using CPU crc32 instructions
2016-12-24T00:19:18.978589Z 0 [Note] InnoDB: Initializing buffer pool, total size = 1G, instances = 8, chunk size = 128M
2016-12-24T00:19:19.185865Z 0 [Note] InnoDB: Completed initialization of buffer pool
2016-12-24T00:19:19.242391Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2016-12-24T00:19:19.369971Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2016-12-24T00:19:19.370106Z 0 [Note] InnoDB: Setting file '/var/db/mysql/ibtmp1' size to 128 MB. Physically writing the file full; Please wait ...
2016-12-24T00:19:19.370833Z 0 [Note] InnoDB: Progress in MB:
 100
2016-12-24T00:19:20.178555Z 0 [Note] InnoDB: File '/var/db/mysql/ibtmp1' size is now 128 MB.
2016-12-24T00:19:20.179934Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2016-12-24T00:19:20.179975Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2016-12-24T00:19:20.180281Z 0 [Note] InnoDB: Waiting for purge to start
2016-12-24T00:19:20.233776Z 0 [Note] InnoDB: 5.7.15 started; log sequence number 2530035
2016-12-24T00:19:20.233971Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/db/mysql/ib_buffer_pool
2016-12-24T00:19:20.234385Z 0 [Note] Plugin 'FEDERATED' is disabled.
2016-12-24T00:19:20.323531Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2016-12-24T00:19:20.323552Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2016-12-24T00:19:20.324579Z 0 [Warning] CA certificate ca.pem is self signed.
2016-12-24T00:19:20.324656Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2016-12-24T00:19:20.324832Z 0 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
2016-12-24T00:19:20.324869Z 0 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
2016-12-24T00:19:20.324904Z 0 [Note] Server socket created on IP: '127.0.0.1'.
2016-12-24T00:19:20.443746Z 0 [Note] Event Scheduler: Loaded 0 events
2016-12-24T00:19:20.443937Z 0 [Note] /usr/local/libexec/mysqld: ready for connections.
Version: '5.7.15-log'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
2016-12-24T00:19:20.496890Z 0 [Note] InnoDB: Buffer pool(s) load completed at 161224  1:19:20
2016-12-24T00:27:51.813730Z 0 [Note] Giving 0 client threads a chance to die gracefully
2016-12-24T00:27:51.813754Z 0 [Note] Shutting down slave threads
2016-12-24T00:27:51.813765Z 0 [Note] Forcefully disconnecting 0 remaining clients
2016-12-24T00:27:51.813778Z 0 [Note] Event Scheduler: Purging the queue. 0 events
2016-12-24T00:27:51.813888Z 0 [Note] Binlog end
2016-12-24T00:27:51.815145Z 0 [Note] Shutting down plugin 'ngram'
2016-12-24T00:27:51.815164Z 0 [Note] Shutting down plugin 'partition'
2016-12-24T00:27:51.815174Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2016-12-24T00:27:51.815183Z 0 [Note] Shutting down plugin 'ARCHIVE'
2016-12-24T00:27:51.815190Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2016-12-24T00:27:51.815244Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2016-12-24T00:27:51.815253Z 0 [Note] Shutting down plugin 'MyISAM'
2016-12-24T00:27:51.815271Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2016-12-24T00:27:51.815280Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2016-12-24T00:27:51.815288Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2016-12-24T00:27:51.815315Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2016-12-24T00:27:51.815352Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2016-12-24T00:27:51.815361Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2016-12-24T00:27:51.815369Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2016-12-24T00:27:51.815376Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2016-12-24T00:27:51.815383Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2016-12-24T00:27:51.815390Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2016-12-24T00:27:51.815397Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2016-12-24T00:27:51.815404Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2016-12-24T00:27:51.815411Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2016-12-24T00:27:51.815417Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2016-12-24T00:27:51.815424Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2016-12-24T00:27:51.815431Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2016-12-24T00:27:51.815439Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2016-12-24T00:27:51.815446Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2016-12-24T00:27:51.815453Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2016-12-24T00:27:51.815460Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2016-12-24T00:27:51.815467Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2016-12-24T00:27:51.815474Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2016-12-24T00:27:51.815481Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2016-12-24T00:27:51.815488Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2016-12-24T00:27:51.815495Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2016-12-24T00:27:51.815502Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2016-12-24T00:27:51.815509Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2016-12-24T00:27:51.815516Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2016-12-24T00:27:51.815523Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2016-12-24T00:27:51.815530Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2016-12-24T00:27:51.815537Z 0 [Note] Shutting down plugin 'InnoDB'
2016-12-24T00:27:51.815606Z 0 [Note] InnoDB: FTS optimize thread exiting.
2016-12-24T00:27:51.815701Z 0 [Note] InnoDB: Starting shutdown...
2016-12-24T00:27:51.916973Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/db/mysql/ib_buffer_pool
2016-12-24T00:27:51.917242Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 161224  1:27:51
2016-12-24T00:27:53.328318Z 0 [Note] InnoDB: Shutdown completed; log sequence number 2530376
2016-12-24T00:27:53.328725Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2016-12-24T00:27:53.328745Z 0 [Note] Shutting down plugin 'MEMORY'
2016-12-24T00:27:53.328756Z 0 [Note] Shutting down plugin 'CSV'
2016-12-24T00:27:53.328765Z 0 [Note] Shutting down plugin 'sha256_password'
2016-12-24T00:27:53.328772Z 0 [Note] Shutting down plugin 'mysql_native_password'
2016-12-24T00:27:53.329005Z 0 [Note] Shutting down plugin 'binlog'
2016-12-24T00:27:53.332214Z 0 [Note] /usr/local/libexec/mysqld: Shutdown complete

2016-12-24T00:27:53.6NZ mysqld_safe mysqld from pid file /var/db/mysql/devnoip.rootservice.org.pid ended
2016-12-24T00:27:54.6NZ mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
2016-12-24T00:27:54.222510Z 0 [Note] /usr/local/libexec/mysqld (mysqld 5.7.15-log) starting as process 65832 ...
2016-12-24T00:27:54.262493Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-12-24T00:27:54.262542Z 0 [Note] InnoDB: Uses event mutexes
2016-12-24T00:27:54.262554Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2016-12-24T00:27:54.262563Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2016-12-24T00:27:54.263042Z 0 [Note] InnoDB: Number of pools: 1
2016-12-24T00:27:54.263196Z 0 [Note] InnoDB: Using CPU crc32 instructions
2016-12-24T00:27:54.265206Z 0 [Note] InnoDB: Initializing buffer pool, total size = 1G, instances = 8, chunk size = 128M
2016-12-24T00:27:54.472599Z 0 [Note] InnoDB: Completed initialization of buffer pool
2016-12-24T00:27:54.548832Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2016-12-24T00:27:54.652098Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2016-12-24T00:27:54.652238Z 0 [Note] InnoDB: Setting file '/var/db/mysql/ibtmp1' size to 128 MB. Physically writing the file full; Please wait ...
2016-12-24T00:27:54.652965Z 0 [Note] InnoDB: Progress in MB:
 100
2016-12-24T00:27:55.468494Z 0 [Note] InnoDB: File '/var/db/mysql/ibtmp1' size is now 128 MB.
2016-12-24T00:27:55.469863Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2016-12-24T00:27:55.469884Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2016-12-24T00:27:55.470176Z 0 [Note] InnoDB: Waiting for purge to start
2016-12-24T00:27:55.543040Z 0 [Note] InnoDB: 5.7.15 started; log sequence number 2530376
2016-12-24T00:27:55.543248Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/db/mysql/ib_buffer_pool
2016-12-24T00:27:55.543534Z 0 [Note] Plugin 'FEDERATED' is disabled.
2016-12-24T00:27:55.575034Z 0 [Note] InnoDB: Buffer pool(s) load completed at 161224  1:27:55
2016-12-24T00:27:55.595895Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2016-12-24T00:27:55.595914Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2016-12-24T00:27:55.596970Z 0 [Warning] CA certificate ca.pem is self signed.
2016-12-24T00:27:55.597050Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2016-12-24T00:27:55.597226Z 0 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
2016-12-24T00:27:55.597264Z 0 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
2016-12-24T00:27:55.597301Z 0 [Note] Server socket created on IP: '127.0.0.1'.
2016-12-24T00:27:55.671918Z 0 [Note] Event Scheduler: Loaded 0 events
2016-12-24T00:27:55.672122Z 0 [Note] /usr/local/libexec/mysqld: ready for connections.
Version: '5.7.15-log'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
[root@devnoip:~] #




Hope that helps.
Comment 54 MattS 2019-05-10 17:13:21 UTC
After recently upgrading to mysql57-server, I was experiencing the issue of not being able to start mysql-server with my.cnf set to 644. I finally changed directory permissions on /usr/local/etc/mysql/ from 755 to 644 and mysql-server started successfully.

I checked my new FreeBSD 11.2 VM with an uninitialized mysql57-server install and /usr/local/etc/mysql/ directory permissions are 755 by default.

I know this is closed, but it's the most informative search result on this issue.