Using Rails 3.2, mysql2 gem, MariaDB 5.5. I got the following error while trying to deploy the app for the first time:
Mysql2::Error: Access denied for user 'abc'@'%' to database 'app_production'
I'm not sure why the percent sign % in 'abc'@'%'.
Here's my database.yml:
production:
adapter: mysql2
encoding: utf8
reconnect: true
host: db.domain.com
port: 3306
database: app_production
pool: 5
username: abc
password: some_password_here
socket: /run/mysqld/mysqld.sock
My /etc/mysql/my.cnf has bind 0.0.0.0, firewall is temporarily disabled with sudo iptables -F.
%is a wildcard. There's more about this in MySQL Error 1045, “Access denied for user 'user'@'localhost' (using password: YES)”) and Allowing wildcard (%) access on MySQL db, getting error “access denied for '<user>'@'localhost'”.