Меняем версию mysql

Замена MySQL 5.5 на MySQL 5.6

Тушим мускул:

# cd /usr/local/
# bin/mysql -u root -p --execute="set global innodb_fast_shutdown=0"
Enter password:
# bin/mysqladmin -u root -p shutdown
Enter password:

Удаляем старые пакеты:

# pkg remove mysql55-server mysql55-client
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 2 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
mysql55-server-5.5.49
mysql55-client-5.5.49

The operation will free 104 MiB.

Proceed with deinstalling packages? [y/N]: y

[1/2] Deinstalling mysql55-server-5.5.49...
[1/2] Deleting files for mysql55-server-5.5.49: 100%
==> You should manually remove the "mysql" user.
==> You should manually remove the "mysql" group
[2/2] Deinstalling mysql55-client-5.5.49...
[2/2] Deleting files for mysql55-client-5.5.49: 100%

Ставим новые из портов:

# cd /usr/ports/databases/mysql56-server
# make config-recursive

Все настройки по умолчанию.

# make install clean
...
[ 90%] Building CXX object sql/CMakeFiles/sql.dir/sql_acl.cc.o
[ 90%] Building CXX object sql/CMakeFiles/sql.dir/sql_admin.cc.o
[ 90%] Building CXX object sql/CMakeFiles/sql.dir/sql_alloc_error_handler.cc.o
[ 90%] Building CXX object sql/CMakeFiles/sql.dir/sql_alter.cc.o
[ 90%] Building CXX object sql/CMakeFiles/sql.dir/sql_analyse.cc.o
[ 90%] Building CXX object sql/CMakeFiles/sql.dir/sql_audit.cc.o
...
===>  Cleaning for mysql56-client-5.6.30
===>  Cleaning for mysql56-server-5.6.30

Стартуем:

# cd /usr/local/
# bin/mysqld_safe --user=mysql --datadir=/path/to/existing-datadir

и апгрейдим базы:

# bin/mysql_upgrade -u root -p

Тушим снова мускул:

# bin/mysqladmin -u root -p shutdown

и уже стартуем нормально:

#/usr/local/etc/rc.d/mysql-server start
Starting mysql.

Проверяем, все ли запустилось как следует:

# ps axw | grep mysql
21963 - Is 0:00,01 /bin/sh /usr/local/bin/mysqld_safe --defaults-extra-file=/www/mysql/my.cnf --user=mysql --datadir=/www/mysq
22255 - I 0:00,17 /usr/local/libexec/mysqld --defaults-extra-file=/www/mysql/my.cnf --basedir=/usr/local --datadir=/www/mysql
22257 0 R+ 0:00,00 grep mysql

У меня не запустилось сразу из-за строки в my.cnf:

log-slow-queries=/var/log/mysql.slow

Как оказалось данный синтаксис был изменён. Написал по новому:

slow_query_log = 1
slow_query_log_file = /var/log/mysql.slow
long_query_time = 10
log_queries_not_using_indexes = 1

Вот и всё.