简体   繁体   中英

How to find the Server Name of MySQL

我在哪里可以找到我将在连接字符串中使用的MySQL名称,以便从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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM