I am trying to access a database server using SSH tunneling, credentials are fine, as i have tested this on MYSQL GUI Client using SSH Tunneling option, i have also just tested this using command line and command line connection to server is also working perfectly using below commands on two command line terminals:
ssh root#192.168.1.1 -L 3307:localhost:3306
mysql -h localhost -P 3307 -u qstats -pPassw0rd stats
But when i try to connect to the database server using pentaho it gives error as
Access denied for user 'stats'#'localhost' (using password: YES)
I then used JNDI and gave the credentials there, but still it does not work, my JNDI settings are as follow:
Asterisk/type=javax.sql.DataSource
Asterisk/driver=com.mysql.jdbc.Driver
Asterisk/user=qstats
Asterisk/password=Passw0rd
Asterisk/url=jdbc:mysql://localhost:3307/stats
Please if someone can help?
You need to initiate the SSH connection separately using CMD to the database server and then try to connect using PDI, and connection will be successful. BUT JNDI still don't work, only direct connection works.
Related
I am successfully able to login to a VM over SSH and to the SQL server from the command line.
But when I try to add a connection on MySQL Workbench and using the same credentials, same host (hostname is an IPV4 address), it says
Failed to Connect to MySQL at <Ip address>:3306 through SSH tunnel at user#VM with user <username>.
Unable to Connect to localhost.
Do anyone have any idea on this issue
I have no mysql installed on my local machine.
Try connecting OVER ssh through commandline and connection was successful. See below
ssh user # <ipaddress of VM>
then
mysql -h <Mysqlhost> -u < user > -p < database > -A
But when I try to do the same via MYSQL workbench, it fails.
Make sure you fill all the details like shown in the image below.
The error message you have posted shows that MySQL Hostname and Username is not filled.
it's my first time using DataGrip trying to connect to MySQL in a Ubuntu 18.04 server.
I've added a new user to MySQL. When I try to connect to MySQL using the command MySQL -u user -p works.
But on DataGrip, I've created an ssh tunnel and it's making the connection without any problems.
But when trying to connect to MySQL it gives this error The specified database user/password combination is rejected: [28000][1698] Access denied for user 'user'#'localhost'.
I am sure that the password is correct and in the log file it is showing that it's making the ssh connection, but it gives access denied when connecting to MySQL. If someone could help me, I appreciate it.
To connect to MySQL server using unix sockets follow an article in DataGrip documentation.
Connection via sockets available in DataGrip since version 2021.1.
I know this question was already asked before (like here), but still I could not find a solution and those posts are quite old.
So I am able to connect to the remote db with an ssh connection and then use the command line like this:
// Putty SSH Connection
host: ssh.strato.de
port: 22
username: xxxxxxx
password: xxxxxxx
// connect to mysql with terminal
mysql -h rdbms -u xxxxxxx -p xxxxxxxx
If I try the same with ssh-tunneling in DBeaver I get an connection error
The ssh-tunneling itself seems to work. If I use the same credentials as above and press "Test tunnel configuration" I get a success message.
I tried several other options for port and host (localhost, rdbms.strato.de, etc), which I found via mysql show variables; show processlist; show user();, but none of them worked.
The Strato Support told me that I can only connect to the db internally with phpmyadmin or remotely wiht putty and mysql, but since the last method is working, shouldn't ssh-tunneling also work?
Dbeaver - Database connection using SSH Tunnel
Open dbeaver
Click on "New Database Connection", in the following "main" window enter the MySQL server host relative to the SSH server, and MySQL running port, my setting is default (localhost, 3306)
specify MySQL user to connect with and user password.
In the "SSH" part, specify the SSH host, port, user also the authentication method used, like SSH private key
Test connection and use.
On shared hosting setups (e.g. IONOS) there might be a restriction when trying to connect to MySQL from external client
https://www.ionos.com/help/hosting/troubleshooting-mysql-databases/connection-and-access-problems-with-mysql-databases/
I am new to AWS. I followed AWS quick start documentation and created my Web server and Database server. I can connect my Web server from my browser and ssh client. But i couldn't connect my MYSQl database from SQL workbench or MySQL yog.
I tried connecting it through command line from my web server its connecting. I thought its due to some user access problem and tried changing the user access by query and it says access denied for giving grant permissions. please suggest me the how to connect to AWS RDS from remote machine(any sql gui tool).
I'm not sure if it's proper way, but you can create ssh tunnel like that:
ssh -N -L 6033:RDSendpoint.rds.amazonaws.com:3306 -i /path/tokey/aws-key.pem ec2-user#EC2IPAddress
And then connect using mysql -h 127.0.0.1 --port=6033 -u yorrdsuser -p from local.
In Netbeans, I need to create a connection to a remote MySql database over SSH. I am given SSH hostname, SSH username, SSH password, MySql hostname (127.0.0.1) and MySql username (root). In a new Connection Wizard I am not sure what to do since there is ssh involved. How should my JDBC Url look like? Is it even possible to achieve this from a gui wizard?
Hmm. I reckon the best way for you to do this is to set up port forwarding before attempting to connect to your remote database via NetBeans.
I'm not sure what OS your using but, assuming you are using some flavour of Linux here are the steps to take:
1) Forward a local port to your remote MySQL Database server
Open up a terminal window and type:
sudo ssh -L 6666:127.0.0.1:3306 <your_SSH_username<#<remoteserver.com>
You'll be prompted for your SSH password. Enter it.
2) In Netbeans go to Services and set up a new MySQL database connection with the following credentials:
host: 127.0.0.1
username: root (I'm assuming that the remote MySQL db allows remote root connections?)
password: password (I guess you must have a password for the MySQL database that you're connecting to?!)
The jdbc url should look something like this:
jdbc:mysql://127.0.0.1:6666?username=root&password=<your_remote_db_root_password>
There's a good post here for more details on port fowarding/tunnelling.
Good luck and I hope this helps!