How to find the Server Name of MySQL - mysql

Where can I find the name of MySQL which I'll use at the connection string to connect to the database from c#?

If you're connecting to a db on the same server, it should be "localhost".
If you are connecting to a remote server, then it should be the FQDN of the remote server (or the IP address) - for example, "dbhost.lan.company.com".

"Unhandled Exception: MySql.Data.MySqlClient.MySqlException: Access denied for user 'root'#'sfn-inkubator-70-61.hib.no' (using password: YES)" error means that you have setup connection address correctly. Client connects to server, but server rejects username and password combination.
So you need to check your server setup, create some user with known password and so on......

It's very possible your host blocks external access to your mysql db, quite a few do. This would explain why you can connect via myadmin.

Related

Issue connecting AWS EC2 instance to GCP database

We are migrating our database from AWS to GCP. Our website is still hosted on an AWS EC2 instance for the moment.
We have allowed GCP to accept incoming connection from port 3306 with our EC2 instance's IP address.
I can ssh in to our EC2 instance and connect successfully to MySQL from the command line (port 3306), but if I try to connect programmatically on our EC2 instance we get a sql error: "Access denied for user 'my-user-name'#'162.8.X.X' (using password: YES)" (IP address is obviously replaced here).
Access denied means that your application was able to successfully connect to your machine. So you can eliminate any network issues.
Check if your user is allowed to make a connection from that IP.
Do this command to see the users:
SELECT user,host FROM mysql.user;
'my-user-name'#'162.8.X.X' should be in there with either the ip, or with 'my-user-name'#'%'.
If the entry is correct, the only thing remaining to check is to see if the actual password is correct.
Access denied for user is a error coming up from MySQL, so check the MySQL logs or password being passed as if there was a problem with your security group you might have got connection timed out error

MySql Remote server connection access denied

I have created a free application using openshift, and created MySQL and phpmyadmin cartridges and inside my phpmyadmin I have gave access to all users from anywhere with all privileges now the problem is when I try to connect from my local MySQL workbench i get connected but I don't see my tables I have created in remote server using phpmyadmin and I can't do any action at all like creating schemas or tables where i get
ERROR 1044: Access denied for user ''#'localhost'
Remember that I allowed all privileges for any user, but I still get access denied for any action except only for the database connection.
Make sure the user you've given full permissions to is the same user MySQL Workbench is connecting as -- there's a difference between the hosts % and localhost for instance. From MySQL Workbench, issue the "Status" command and compare the username and host against what you've configured.
You're apparently connecting through 'localhost' so you have to give full permissions to the anonymous user with host localhost (or change your connection type to tcp so that your connection is via 127.0.0.1 instead of localhost).
Edit for further clarification: The MySQL permission structure treats different types of connections differently; a client connecting via TCP connection always appears to come from an IP address, even if it's from the "local host" (in the sense of being on the same machine), in which case that IP address of the incoming connection may be 127.0.0.1. Socket type connections are registered in MySQL as coming from the host "localhost" (literally, in this case). This is why we're verifying which host MySQL Workbench is connecting as.
Different connection types appear differently to MYSQL even if they're coming from the same "local machine." Furthermore, the wildcard host does not include 'localhost' socket connections, those are a separate entry in the permissions field with the 'localhost' host name; the wildcard does not apply, as I explained above. This is the reason why we're checking which permissions you set against what MySQL Workbench is connecting as; it's the most common cause of difficulties such as these.

ODBC connection access denied MySQL

I am able to connect to the remote mysql database that is on a different domain that are in the same network, from the sql workbench(using servername.domain.com), but am unable to set up an ODBC connection using the same connection parameters.
I tried to connect using TCP/IP could not succeed. I get "Access denied for user" error, as its trying to connect using the current domain as the host. But the database server is on a different domain.How do we change the domain ?
I was not sure how to use named pipes, any help there would be appreciated.Thank you!

MySql server denies access at localhost

Working on a simple JDBC program to communicate with a MySQL server. The Eclipse Helios is reporting this error:
SqlException: `access is denied at localhost`.
I don't know if I have the wrong server's passwordor the database's password. I provide the username and password along with the URL of the server to the JDBC class driver. I created the password with mysql_embedded.exe.
Would it matter if I created the database with MySQL Workbench or with mysql_embedded.exe? Or simply a password issue?

How to Connect Excel to ONLINE Mysql Database in my Domain using ODBC?

I've been trying to connect Excel to online mysql database.
Im using 5.1 DSN ODBC, gone through the process but when im establishing the connection of mysql and excel an error occured.
Connection Failed: [HY000] [MYSQL][ODBC 5.1 Driver]Access denied for user 'icafeown'#'118.252.49.9'(userpassword: YES)
I've been in the same questions like this but i cant establish the correct connection.
im using Cpanel for the domain and i already used Remote MySQL.
and the Database: Dropdown are empty.
Thank you.
Access denied means that you've successfully established a TCP connection to the MySQL server, but don't have appropriate permissions within MySQL to actually "log in" to the server.
Usually this is because of a mis-match on the 'host' portion of the MySQL user account. e.g. You may have created a someone#example.com account in MySQL, but your client's IP address cannot be reverse-lookuped to confirm that it is "example.com". MySQL only sees the IP you connect from, not the hostname. If your 118.252.49.9 can't be resolved to be 'example.com', you won't get it.
Same goes for connections on the same machine. You may have your someone#example.com MySQL account, but MySQL will see a connection come in from 127.0.0.1/localhost, which is NOT "example.com".