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

o227786060@gmail.com's avatar

forege database

forge+tableplus [i use ssh key] The connection is successful and it can work but local rejected robert@liuzhanfude-MBP blog % mysql -uroot -p Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

I would like to know how to do it on my local side. Thank you!

0 likes
20 replies
Tray2's avatar

Not sure where it fails from your description.

Does it work when you ssh into the server and connect from the command line?

Is it when you try to connect from your local server using table plus it fails?

1 like
o227786060@gmail.com's avatar

@Tray2 thank you for replying

I am here .env I typed correctly DB_USERNAME DB_PASSWORD but was rejected

I don't know how to properly spot the problem

Tray2's avatar

@o227786060@gmail.com I still don't understand what exactly the problem you are facing is?

However you usually on a production server disable remote access with the root user, and rather use a user that only has access to the database that the application uses.

1 like
Sinnbeck's avatar

@o227786060@gmail.com if I understand you correctly, you need to open a connection to your server that laravel can use. This is called a reverse shell

Example:

ssh -fNL 3305:localhost:3306 [email protected]

This will allow laravel to connect on localhost (or 127.0.0.1) port 3305

Be aware that you need to rerun this command after your computer restarts

1 like
o227786060@gmail.com's avatar

Running advice ssh -fNL 3305:localhost:3306 forge@my forge ip

Enter passphrase for key '/Users/robert/.ssh/id_rsa': -> mysqlsh --host=127.0.0.1 --port=3306 -u forge -p still fail.....

massage SQL Error 1045 (28000): Access denied for user 'forge'@'localhost' (using password: YES) what can I do?

o227786060@gmail.com's avatar

@Sinnbeck robert@liuzhanfude-MacBook-Pro ~ % ssh [email protected] -L 3306:127.0.0.1:3306 -N Enter passphrase for key '/Users/robert/.ssh/id_rsa': bind [127.0.0.1]:3306: Address already in use

seems to be successful but the local But still can't get in

o227786060@gmail.com's avatar

@Sinnbeck When I execute the following command mysqlsh --host=127.0.0.1 --port=3306 -u forge -p

still fails... ERROR 1045 (28000): Access denied for user 'forge'@'localhost' (using password: NO)

o227786060@gmail.com's avatar

@Sinnbeck robert@liuzhanfude-MacBook-Pro ~ % ssh [email protected] -L 3305:127.0.0.1:3306 -N Enter passphrase for key '/Users/robert/.ssh/id_rsa': bind [127.0.0.1]:3305: Address already in use channel_setup_fwd_listener_tcpip: cannot listen to port: 3305 Could not request local forwarding. is this correct?

o227786060@gmail.com's avatar

@Sinnbeck robert@liuzhanfude-MacBook-Pro ~ % ssh -fNL 3305:localhost:3306 [email protected] Enter passphrase for key '/Users/robert/.ssh/id_rsa': robert@liuzhanfude-MacBook-Pro ~ % ssh [email protected]

Enter passphrase for key '/Users/robert/.ssh/id_rsa': Welcome to Ubuntu 20.04 LTS (GNU/Linux 5.4.0-1009-aws x86_64)

System information as of Thu Sep 15 18:25:45 UTC 2022

System load: 0.0 Processes: 135 Usage of /: 26.3% of 19.32GB Users logged in: 0 Memory usage: 41% IPv4 address for ens5: 10.0.1.102 Swap usage: 1%

70 updates can be applied immediately. 9 of these updates are standard security updates. To see these additional updates run: apt list --upgradable

New release '22.04.1 LTS' available. Run 'do-release-upgrade' to upgrade to it.

3 updates could not be installed automatically. For more details, see /var/log/unattended-upgrades/unattended-upgrades.log

*** System restart required *** Last login: Thu Sep 15 18:13:40 2022 from 223.140.137.232 forge@clean-cloud:~$

How do I get data into this database?

Sinnbeck's avatar

@o227786060@gmail.com so it sounds like it ran successfully? No errors. You can how connect to the database on localhost on port 3305. Put it in laravels env and it should work

1 like

Please or to participate in this conversation.