DEV Community

Nahue
Nahue

Posted on • Originally published at nahuelhds.dev on

1

Solving MariaDB errors on Travis CI

ERROR 1698 (28000): Access denied for user ‘root’@’localhost’

You need to use sudo in the line execution. Yeah. Just that.

I had this .travis.yml file

addons:
  mariadb: 10.4

before_script:
  - mysql -e 'create database testing;'

Notice the mysql -e 'create database testing;' line. The fix was using sudo

addons:
  mariadb: 10.4

before_script:
  - sudo mysql -e 'create database testing;'

SQLSTATE[HY000] [1698] Access denied for user ‘travis’@’localhost’

This error happens because Travis by default uses dist: xenial which is not fully compatible with the MariaDB addon yet.

The solution is setting dist: precise in your .travis.yml file

dist: precise

# ... rest of your config file

And that’s it. Hope it helps!

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay