# FreeBSD mysql 5.6 update to  5.7



## bagas (Nov 8, 2019)

Hello.
Previously, I did not have to update to a hot database server.
Please tell me how best to update the mysql server.

Now the system is FreeBSD 12, mysql 5.6, innodb structure.
The base is not small at 5-9 gigs, a few bases.

I think so, be sure to backup database first, just in case.
After stop the database server.
Remove mysql56-server and mysql56-client ports
Install new mysql57-server and mysql57-client ports.
Start updating system tables mysql_upgrade-u root-p
Start mysql.
That's all.
Have I forgotten anything?"


----------



## SirDice (Nov 8, 2019)

bagas said:


> Start updating system tables mysql_upgrade-u root-p
> Start mysql.


These need to be the other way around, `mysql_upgrade` needs a running MySQL server. I usually configure MySQL to bind to 127.0.0.1 to prevent any remote access from interfering. Start the service, then run mysql_upgrade(1). Once that's done I shutdown MySQL, allow remote access, then start it again.


----------



## bagas (Nov 8, 2019)

SirDice said:


> These need to be the other way around, `mysql_upgrade` needs a running MySQL server. I usually configure MySQL to bind to 127.0.0.1 to prevent any remote access from interfering. Start the service, then run mysql_upgrade(1). Once that's done I shutdown MySQL, allow remote access, then start it again.


Of course, backup databases before updating mysql.


----------

