I can't access mysql through terminal on fortrabbit. I follow all steps but it is rejecting my password. However I can regullary login through ssh and edit my application. Anyone had that issue ? Thanks.
相关问题
- Laravel Option Select - Default Issue
- sqlyog export query result as csv
- NOT DISTINCT query in mySQL
- MySQL: conduct a basic search
- Laravel 5.1 MethodNotAllowedHttpException on store
I have solved this in the past using a SSH tunnel. You open an SSH tunnel to the server, and then you connect to the MySQL server there from the endpoint of that tunnel. As such, to MySQL you appear to be connecting locally.
From the terminal:
First you need to open the tunnel, you can do it like this:
This opens port 8889, then opens a tunnel to
your.fortrabbit.domain.com
, then forwards that local port through the tunnel to the IP 127.0.0.1 and port 3306 relative to the server atyour.fortrabbit.domain.com
.The options in more detail:
-N
: Do not execute a remote command.-L
: Specifies the ports (local and remote).8889
: Your local port that is being forwarded.127.0.0.1
: the remote IP to which you're forwarding, relative to the server which ssh is connecting to3306
: the remote port to which you're forwarding.username@your.fortrabbit.domain.com
: Your username and domain with fortrabbit.Now you're ready to open the connection. In the same terminal, use the following command:
port 8889 is now being forwarded to the port and IP of your MySQL server on the fortrabbit side, so just replace
mysql-username
with your username on the mysql server, and you're connected!From a GUI:
You mentioned in your comments that you're using Ubuntu, so install MySQL Workbench from the Software Centre or here, create a
New Connection
and select the connection type as "Standard TCP/IP over SSH
".You will need to configure the following:
SSH Hostname
: the hostname or IP of your ssh account with fortrabbitSSH Username
: your username with themSSH Password
: your password with themSSH Keyfile
: If you use keys for authentication, select the private one here.MySQL Hostname
: 127.0.0.1 (because it's local to the endpoint of your tunnel.MySQL Server Port
: normally "3306".Username
: The username for the DBPassword
: The password for the DBDefault Schema
: Whatever should be the default schema for this DB (can be left blank).That should then connect from wherever you are!