Cannot connect to MySQL database on home computer - mysql

Description
I've downloaded MySQL installer 5.7.21 for Windows onto my windows 10 machine and setup a server on port 3306 (I see the server status is "Running" within MySQL workbench, and I've also confirmed this by looking in Windows "Services" settings).
I created a database on this server with a dummy table. I have no issue executing sql statements.
Within the Windows firewall I set both "mysql_port_3306" and "Port 3306" as "Allowed App"s.
In MySQL Workbench I connected to the server and issued the (deprecated) command
GRANT ALL ON *.* TO 'username'#'1.2.3.4' IDENTIFIED BY 'password';
with username, 1.2.3.4, and password replaced by my username, the IP address of my laptop (a different cpu than the one I'm setting this server up on), and the password.
On the laptop I created a new connection within MySQL Workbench with the following connection parameters:
Connection Method: Standard (TCP/IP)
Hostname: the full name of the computer hosting the database (which is also the server host name)
Port 3306
Username and Password: the same values set in the SQL statement above
Problem
After doing all this when I test the connection on my laptop the program goes into "Not Responding" status for a short time then becomes usable again without giving results for the connection test. If I try to connect I receive the following error:
Cannot Connect to Database Server
Are there other steps I need to take to connect to the server I've created? Most of the guides I read have to do with installing the workbench, starting the server, or connecting to a server which is already configured to allow remote connections, but I feel I'm missing a step.
Thanks!

Related

Remote MySql Database CPanel

I want to connect a remote MySql database from MySql workbench but I got an error:
"IO Error: [Errno None] Unable to connect to port 22 on or
xx.xx.xx.xx"
What should I do?
I already add my IP to remote host
when I delete IP that makes the error, then I'm trying to connect, that IP showed up again in my remote host
So how can I connect to my database from MySQLWorkbench?
How to Connect to a Database with MySQL Workbench
One tool you can use to connect to remotely connect to databases on your shared, VPS, or Dedicated hosting account is MySQL Workbench. MySQL Workbench is a free tool you can use to connect to your server databases from your personal computer. MySQL Workbench can be Downloaded for free at the following link:
http://dev.mysql.com/downloads/workbench/
You will want to use the Windows (x86, 32-bit), MSI Installer if you are on Windows. The file we are installing in this tutorial is the mysql-workbench-gpl-5.2.47-win32.msi file.
Once you have downloaded MySQL Workbench, you can install it onto your computer. After you have the program installed, follow the steps below to set up a remote connection.
Add IP to your Remote MySQL
In order for you to be able to connect to your databases remotely you will need to add your local computer IP address to the Remote MySQL in cPanel.
Steps to connect to your database remotely
Open MySQL Workbench.
Click New Connection towards the bottom left of MySQL Workbench.
In the "Set up a New Connection Dialogue" box, Type your Database
connection credentials.
The credentials will be like the following:
Connection Name: You can name this whatever you like.
Connection Method: Standard (TCP/IP).
Hostname: You can use your domain our your cPanel IP address.
Port: 3306
Username: Your cPanel username or the user you created for the
database.
Password: cPanel password or the password for the database user that
was created.
Default Schema: This can be left blank.
Click Test Connection.
Type your password and click the "Save Password in Vault" check box.
Click Ok.
MySQL Workbench should say "Connection parameters are correct". Click Ok.
Click Ok again to accept the connection settings.
Now under the SQL Development section you will see your connection listed in the Open Connection to Start Querying box. Click your newly created account.
Now you will see the databases list in the area on the left.

Can't connect to remote MySQL server on Windows

I'm trying to set up a MySQL server on Windows that will allow another computer to connect to it remotely. The client computer is getting a 'Can't connect to MySQL server' error in MySQL Workbench.
Both computers are on the same network, and the server is using a static IP address (I have forwarded ports in my router to allow external connections to the public IP address).
What I've tried (suggested by other threads):
In my.ini, setting bind-address = 0.0.0.0 / commenting out bind-address / commenting out skip-networking
Running GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'#'IP' IDENTIFIED BY 'PASSWORD';. When I run this, I get the error Using GRANT statement to modify existing user's properties other than privileges is deprecated and will be removed in a future release; however I can confirm that in Workbench, the user's privileges are all checked (under the 'Users and Privileges' screen).
In my router settings, forwarded port 3306 on the server's static IP address
Disabling the Windows Firewall on the server.
Verified that the MySQL Server Windows Service is running.
Can anyone advise?
Ref: Try connecting with mysql cli instead of work bench from the remote machine, so u can isolate that cli client u r able to access the remote DB. because the following reason might be causing connectivity issue in Workbench.
mysql cli cmd
install mysql.exe client program
from cmd prompt> mysql -hhostname -uusername -ppass dbname
Cannot connect to Database server (mysql workbench)
In MySQL Workbench (5.2.47 CE)
click Mange Server Instances (bottom right corner)
click Connection
in the Connection box select:
Local Instance ($ServerName) - root#127.0.0.1:3306 '<'Standard(TCP/IP)>
click Edit Selected...
under Parameters, Hostname change localhost or 127.0.0.1 to your NetBIOS name
click Test Connection

If the server on my mac is not running for MySQL, is can I try to run other databases on my machine?

I have a java project which connects to a MySQL database. Earlier it was working fine, but I think I messed up some of the configuration settings when trying to connect not via localhost. After messing around for hours and not making any progress (including completely reinstalling MySQL onto my mac and pc ( I was trying to connect these) ) I have given up and now am thinking of using some other database software like Postgre. Will the same error come up since its to do with not being able to connect as the server is not running?
The error at the moment is:
Your connection attempt failed for user 'root' from your host to server at 127.0.0.1:3306:
Access denied for user 'root'#'localhost' (using password: YES)
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

Tableau error connecting to local MySQL db

Windows Server 2008
Tableau Desktop 7.0
Local MySQL database using Xampp
When attempting to connect to a localhost MySQL database server using the native MySQL data connection in Tableau Desktop, I'm getting the following error:
"The connection to the data source might have been lost.
Communication with the Tableau Protocol Server process was lost.
Unable to connect to the server "localhost". Check that the server is running and that you have access privileges to the requested database.
Unable to connect to the server. Check that the server is running and that you have access privileges to the requested database."
When using "Other Databases (ODBC)" in Tableau, I am able to connect and return data. However, I would prefer to use the MySQL connection to avoid the limitations of the Other Databases connection.
I created a specific username in phpmyadmin as well as tried using the root username and password and the same error was returned. I created a user DSN in odbcad32.exe and attempted using multiple versions of the MySQL ODBC driver (3.5, 5.2.7, 5.3.4).
Does anyone have any ideas of what might be causing the error? Really appreciate any help.
A bit late in replying but....
MySQL user connections are based on a combination of username,password AND the host you are connecting from.
If you are connecting to MySQL on the same host as Tableau server, then the connecting host could be seen as '127.0.0.1', 'localhost', '::1' or even a hostname if MySQL is configured to resolve those.
The simple way to test would be to set the host field to '%' for the user you are trying to connect as. I would not recommend this for your root user entry or other accounts with significant privileges.

Connecting to MySQL on AWS via Query Browser While Outside the U.S

I am running MySQL on an Amazon AWS Instance. I was able to previously connect to the MySQL Database via MySQL Query Browser. Now I am traveling outside the U.S. and I am having trouble connecting via the Query Browser. I am able to use Terminal to create an ssh connection and then login to MySQL, so it does not appear to be a larger issue with the MySQL Database.
Has anyone else had a similar problem? Any ideas how I can fix this?
This is the error I get from the MySQL Browser
Your connection attempt
failed for user 'admin' from your host to server at
ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com:3306: Can't connect to
MySQL server on 'ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com' (4)
Please: 1 Check that mysql is running on server
ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com
2 Check that mysql is
running on port 3306 (note: 3306 is the default, but this can be
changed)
3 Check the admin has rights to connect to
ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com from your address (mysql
rights define what clients can connect to the server and from which
machines)
4 Make sure you are both providing a password if needed and
using the correct password for
ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com connecting from the host
address you're connecting from
The only possible problem I see could be #4, but I ran and re-ran this command via Terminal:
grant all privileges on *.* to 'admin'#'%' identified by '<pass>' with grant option;