Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

drmonkeyninja's avatar

Unable to login to mysql using user created through Laravel Forge

I am new to Laravel Forge and have been following the Laracast series on setting things up. In particular the Manage Your Databases lesson for setting up MySQL. However, whenever I create a new database and user through Forge I am unable to connect to mysql using that user either through Sequel Pro or if I ssh into the server. For example:

mysql -u test -p

This prompts me for my password and then always gives me the following error message:

ERROR 1045 (28000): Access denied for user 'test'@'localhost' (using password: YES)

I get a similar error when attempting to connect via Sequel Pro.

I am able to login successfully both via the terminal and Sequel Pro for my forge user, but I would prefer to use different users for different databases.

Is there another step that I am missing?

0 likes
4 replies
Screenbeetle's avatar

You may be confusing your Linux / ssh user with your MySql users - by default they are both called forge. Even if you set up a new database user you'll still need to use your forge (linux) user to ssh into the server.

drmonkeyninja's avatar

@SCREENBEETLE - Thanks for replying, but I don't think this is my issue. When I run mysql -u test -p I have already ssh'd onto my server using the forge user and am trying to connect to MySQL using a user called test that I have created using Laravel Forge.

Screenbeetle's avatar

Yeah ok that's odd. Assuming you've double checked you're using the right password then I can only suggest some basics:

1 Have you checked inside MySql if the test user exists? As in login as forge user and run

SELECT User FROM mysql.user;

2 Have you tried creating the user within MySql?

drmonkeyninja's avatar
drmonkeyninja
OP
Best Answer
Level 4

@SCREENBEETLE - Thanks again for your help.

The user existed, but for some reason the password being set by Forge was incorrect. I've fixed my issue by directly updating the user's password in mysql.

I thought that perhaps I'd mistyped it the first time, but after several further attempts it seems that Forge is messing up the password I set each time. Seems like the issue is with whatever Forge is doing to create the user.

Please or to participate in this conversation.