0

我正在尝试将我正在使用的 SQL 版本简单地打印到网页上,这是我老师提供的代码,我已经放入了我的服务器和数据库,我不知道如何找到我的数据库用户名,如果它有密码。

// add here your connection details
String connectionString = "SERVER=127.0.0.1; DATABASE=dblogin;"
+ "UID=YOUR_DB_USERNAME; PASSWORD='';";
// create and open a connection to the database
MySqlConnection connection = new MySqlConnection(connectionString);
connection.Open();
// print the MySQL version in a console
ReturnError.Text = ("MySQL version: " + connection.ServerVersion);
// this line will prevent the console from closing immediately
 // to close the console just press any key
4

1 回答 1

0

在安装 mysql 期间,它通常会询问root用户名和密码,尝试root使用空密码,如果它不起作用 - http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html

于 2013-10-15T22:39:32.653 回答