2013-10-15 2 views
0

나는 사용중인 SQL 버전을 웹 페이지에 인쇄하려고합니다.이 코드는 선생님이 제공 한 코드이며, 서버와 데이터베이스를 넣었습니다. 내 DB 사용자 이름을 찾고 비밀 번호가 있다면. 그것이 작동하지 않는 경우가 보통 root 사용자 이름과 암호를 요구 mysql을 설치하는 동안MySQL : 데이터베이스 사용자 이름 찾기

// 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 

답변

관련 문제