# mysql can't start after upgrade



## m_pahlevanzadeh (Dec 28, 2021)

I upgrade my freebsd and all of my packages, But mysql can't start after upgrade.
How do I start it?
By the way, My MySQL doesn't create any log messages.


----------



## VladiBG (Dec 28, 2021)

MySQL :: MySQL 5.7 Reference Manual :: 2.11.3 Changes in MySQL 5.7
					






					dev.mysql.com
				




If you want more detail answer you should provide more information like error log.


----------



## Alain De Vos (Dec 28, 2021)

Before upgrading the mysql/mariadb packages it's mostly a good idea to first make a backup/dump of the database.
After the upgrade you then do a restore.


----------



## covacat (Dec 28, 2021)

by default it logs to /var/db/mysq/${hostname}.err


----------



## m_pahlevanzadeh (Dec 28, 2021)

Now, I need to my data, What's your solution to run my mysql?


----------



## Alain De Vos (Dec 28, 2021)

The adviced way is to revert/return to the lastest previous version which was working correctly and then make a backup of the database. Then you can upgrade at new.


----------



## forquare (Dec 28, 2021)

IIRC, when I've had this in the past I've needed to use the mysql_upgrade(1) utility.  You might want to read the documentation around it though as I may be misremembering!


----------



## jbo (Dec 28, 2021)

forquare said:


> IIRC, when I've had this in the past I've needed to use the mysql_upgrade(1) utility.  You might want to read the documentation around it though as I may be misremembering!


OP didn't provide any MySQL version number but mysql_upgrade(1) is deprecated since 8.0.16: https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-16.html


----------



## SirDice (Dec 28, 2021)

And you don't need to run mysql_upgrade(1) for patch versions. Only if you updated from 5.6 to 5.7 for example. Which I assume is not the case here.


----------

