简体   繁体   English

SqlException:服务器不存在或连接被拒绝

[英]SqlException: Server does not exist or connection refused

I am using c# on monodevelop on Ubuntu x64. 我在Ubuntu x64的monodevelop上使用c#。 I am trying to use Mono.Data.Sqlite to connect to a local (localhost) database but I cant connect to it. 我正在尝试使用Mono.Data.Sqlite连接到本地(localhost)数据库,但是我无法连接到它。 This is my connection string: 这是我的连接字符串:

 string connsqlstring = "Server=localhost;" + 
"Database=wsep;" + "User ID=root;" + "Password=1234;" + "Pooling=false";

But I keep getting: 但我不断得到:

System.Data.SqlClient.SqlException: Server does not exist or connection refused.

I have started the server (sudo /etc/init.d/mysql start) What am I missing? 我已经启动了服务器(sudo /etc/init.d/mysql start),我缺少什么?

Simply put, SQLite isn't the same thing as MySQL . 简而言之, SQLiteMySQL不一样。 They're different databases. 他们是不同的数据库。

SQLite is a flat file database, the mono side of which you can read about here . SQLite是一个平面文件数据库,您可以在这里阅读其单面信息。

MySQL has information on the mono website and that page also provides links to downloading the MySQL connector for use with your mono projects. MySQL 在mono网站上提供了信息,该页面还提供了下载MySQL连接器以供您的mono项目使用的链接。 You will want to look at these links for working with MySQL. 您将需要查看这些用于MySQL的链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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