By cbolanosmx
as i was following the tutorial to install mysql i have been struggling to connect from my MAC,
i already changed the bind-address in mysql conf to the public ip4 address.
i have enabled root and i created a separate user account, but still cant connect.
i also tried with sudo ufw allow 3306/tcp, sudo service ufw restart.
the error I’m getting is the following.
[08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up. com.mysql.cj.exceptions.CJException: null, message from server: “Host ‘C-XX-XXX-XXX-XXX.{some host}.net’ is not allowed to connect to this MySQL server”.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Based on your error message above, I believe that your MySQL and UFW configuration is correct and your MAC has successfully connected to the MySQL server software. But MySQL refused your MAC connection because the MySQL account used to connect was not allowed. That means you entered a wrong host value when creating the separate user account. Try to create a different MySQL account with the correct host value C-XX-XXX-XXX-XXX.{some host}.net mentioned in the error message. For example:
CREATE USER 'sammy'@'C-XX-XXX-XXX-XXX.{some host}.net' IDENTIFIED BY 'password';
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.