It seems like an issue with access control due to settings PRIVILEGES. Remember that localhostthis is a special case that does not apply to %granting rights, since it will connect through the local UNIX socket, and not the TCP port of port 3306.
You must verify that you can connect to the same computer that the application is running using the command line tool mysql:
mysql --user=frederic --password=test dealers
At this point, you should get the same error as the Mysql2 driver.
, :
GRANT ALL PRIVILEGES ON dealers.* to `frederic`@`localhost` IDENTIFIED BY 'test'