Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find the Server Name of MySQL

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

like image 355
Ahmad Farid Avatar asked Nov 10 '10 12:11

Ahmad Farid


3 Answers

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".

like image 78
warren Avatar answered Oct 05 '22 22:10

warren


"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......

like image 28
MiSHuTka Avatar answered Oct 05 '22 22:10

MiSHuTka


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.

like image 37
Toby Allen Avatar answered Oct 05 '22 23:10

Toby Allen