Can't connect to database with db client [08001] - mysql

I am using laravel homestead on linux and when I want to connect to database with phpstorm or DBeaver I receive:
[08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up.
Index 5 out of bounds for length 5.
I investigate and find that problem could be with jdbc driver but all of my drivers are up to date. On homestead I use mysql 5.7 and both (phpstrom and DBeaver) are up to date.

I finally figure out. For homestead on linux you need to pass this credentials:
host: 192.168.10.10
instead of 127.0.0.1 or localhost
username and password are the same: homestead and secret

Related

Can't connect to digital ocean LEMP stack MySql via Workbench (or any gui) but CAN connect via terminal mysql cmd

I have tried suggestions in what seems like every post about this topic and none of them have worked for me, so I'm posting my own in case anyone spots anything that I missed.
I'm migrating a wordpress site into a LEMP (ubuntu, apache) stack instance on Digital Ocean, and I need temporary access to the database via MySQL Workbench or something similar on my local machine. I'm planning to turn it off once the migration is done. However I am having a very weird issue I can't figure out the cause for.
If I attempt to sign into the sql instance using
mysql -u user -h my.ip.address -p
I can get access from my local machine just fine.
I can also SSH into the server itself via terminal just fine, I have it set up in my ssh config file using the same ip address and the same user and ssh key i'm attempting to use for my workbench connection.
However doing the same via an SSH connection on workbench I constantly get the error:
Authentication failed, access denied.
Failed to connect to MySql at my.ip.address:3306 through ssh tunnel at user#127.0.0.1 with user mysqluser
Things I've done to attempt to rectify this:
set bind-address in mysql config to 0.0.0.0 on the server and restarted server's mysql
set bind-address in mysql config to my.ip.address on the server and restarted
allowed tcp connection
allowed connection via ufw firewall to 3306 and 33060 ports
created a mysql user with all privileges granted for 'localhost', '%', and '0.0.0.0' hosts
tried sshing in as root user
tried using the root user for the mysql user
I am probably missing some things on that list as I feel like I've tried a million things already!
I even have a different server on a LAMP stack (not LEMP) that I set up a few days ago and was able to gain access to the mysql db on workbench by following the same steps, and even attempted backtracing and copying what I did on the LAMP server, but no go.
I checked to see the netstats of the mysql instance and match the port and the ip and that didn't work, I made sure the port of the SSH was correct, nothing is working.
Does anyone have any tips? I've been using all of the "allow remote mysql connection on digital ocean" articles and questions i can find but nothing is working.
Here is my Workbench connection config at the moment but i have tried what feels like every iteration of it i could think of (re users, passwords, IP addresses, and ports)
SSH Hostname: my.ip.address
SSH Username: user
SSH Password: user-password (also tried empty, since i have a key)
SSH Key File: same key file i use to ssh on terminal
Mysql Hostname: 127.0.0.1 (also tried my.ip.address)
MySql Server Port: 3306 (also tried 33060)
Username: MySqlUser
Password: MySqlUser-Password (works when connecting to mysql via terminal)

SSH error when trying to connect to laravel forge database with mysql workbench (can connect fine through a console)

I'm having trouble connecting to my database through mysql workbench even though I can do it through a console. It doesn't seem like I'm even getting past ssh because this is my error
Here are my connection settings:
Connection Method: Standard TCP/IP over SSH
SSH Hostname: DropletIP:22
SSH Username: forge
SSH Key File: C:\Users\username\.ssh\id_rsa
MySQL Hostname: 127.0.0.1
MySQL Server Port: 3306
Username: forge
The workbench is version 8 and the mysql version on the droplet is version 8.
I've tried switch all kinds of stuff around like removing the port on the ssh hostname, trying the public ssh key instead of the private, and changing the mysql hostname to the DropletIP. None of these worked.
Not really sure why this is happening. I appreciate any help.
you should use the server IP address as your MySQL HOSTNAME

Trying to connect to VM VirtualBox MySQL from Windows 7 using MySQL Workbench

I am trying to save myself some time and eye strain by connecting my to MySQL on my VM (Ubuntu 14.04)
I have a bridged connection set up, and I test my web applications on my windows by simply navigating to http://ip_of_vm/application/index.php, so I know that they are communicating. However, when I tried setting up the connection in MySQL Workbench, I come to a screeching halt. Here are my connection parameters:
Hostname: ip_of_vm
Port: 3306 (Default)
Username: tim -> Which is a user created on my VM using: CREATE USER 'tim'#'%' in MySQL
Password: **** -> No I'm not going to paste my password here.
Default Schema: test_database
But when I press test connection I get this error:
Failed to connect to MySQL at ip_of_vm with user tim.
Can't connect to MySQL server on ip_of_vm (10061)
I've tried searching for that error code and making some adjustments based on what I've found, but I'm still having no luck.
Any suggestions would be greatly appreciated.

Trouble Creating a connection in MySQL Workbench

I am using Fedora 18 and recently installed MySQL workbench.
I created a new connection in MySQL workbench, but when trying to open I get the following error:
Cannot Connect to Database Server
Your connection attempt failed for user 'root' from your host to server at 127.0.0.1:3306:
Can't connect to MySQL server on '127.0.0.1' (111)
Please:
Check that mysql is running on server 127.0.0.1
Check that mysql is running on port 3306 (note: 3306 is the default, but this can be changed)
Check the root has rights to connect to 127.0.0.1 from your address (mysql rights define what clients can connect to the server and from which machines)
Make sure you are both providing a password if needed and using the correct password for 127.0.0.1 connecting from the host address you're connecting from
Any idea what the issue would be?
Fedora 18 is a Linux Based Operating System and it works on chmod 777. so there should be authentication problem. otherwise server 127.0.0.1 and host name , username same as we keep in windows. you need to set authentication.

Trying to connect Coldfusion 9 to a MYSQL Datasource that was installed via MAMP (free) is throwing an error

I am trying to connect Coldfusion 9 to a MYSQL Database that was installed by MAMP (free not Pro) with the following parameters:
CF Data Source Name: MyDatasource
Database: MyDatabase
Server: localhost
Port: 8889
Username: root
Password: root
In the coldfusion Administrator I can successfully connect to this database. However, when I try to display a .cfm page that has a connection to that datasource, this error is thrown:
Error Executing Database Query.
Could not create connection to database server. Attempted reconnect 3 times. Giving up.
Any ideas??
Any help would be immensely appreciated!!
edit
this is what MAMP wants me to use and it did create a successful connection in CF Admin.
In the CF admin, if you click "Verify" it shows a successful connection? Usually MySQL databases are on port 3306 not 8889. Are you sure you have the correct settings?
So, after searching and trying to figure out what is going on, I decided to check my Application.cfm file, and sure enough, I have global connection strings for all of my queries. One of those strings was the DB password, which was not set to "root".. Thank you for your help and I apologize for the stupid question..