MySQL said: Access denied for user 'user'@'%' code example
Example 1: mysql access denied for user 'root'@'localhost'
sudo mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
Example 2: mysql user permission database
GRANT ALL PRIVILEGES ON `db_name`.* TO 'user'@'host'