I was trying to create a user using:
docker exec -i database mysql -uroot -proot -e "CREATE USER 'dbadmin'@'%'"
However I ran into this ERROR:
ERROR 1054 (42S22) at line 1: Unknown column 'password_last_changed' in 'mysql.user'
On Windows, you must run mysql_upgrade with administrator privileges. You can do this by running a Command Prompt as Administrator and running the command. Failure to do so may result in the upgrade failing to execute correctly. You should always back up your current MySQL installation before performing an upgrade.
MySQL is one of the most popular SQL-compatible relational databases. Running MySQL inside a Docker container lets you separate your database from your code. You can also use a container orchestrator like Kubernetes to scale MySQL independently of your API server instance.
After googling for a few hours, I found the answer in this blog post:
docker exec -it container_name bash -c "mysql_upgrade -uroot -proot"
root
must be your mysql username and password
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With