[MySQL] 외부에서도 Root 접속 가능하게 설정하기
관련 URL :
http://odeng.tv/mysql-root-%EC%A0%91%EC%86%8D-%EA%B0%80%EB%8A%A5-%EC%9B%90%EA%B2%A9%EC%A7%80-%EC%B6%94%EA%B0%80/
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Net; using System.Xml; namespace WindowsApplication2 { public partial class Form1 : Form { string currentPage = "1"; //현재 페이지 string countPerPage = "1000"; //1페이지당 출력 갯수 string confmKey = "TESTJUSOGOKR"; //테스트 Key string keyword = string.Empty; string apiurl = string.Empty; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { try { keyword = textBox1.Text.Trim(); apiurl = "http://www.juso.go.kr/addrlink/addrLinkApi.do?currentPage=" + currentPage + "&countPerPage=" + countPerPage + "&keyword=" + keyword + "&confmKey=" + confmKey; textBox2.Text = apiurl+"\r\n"; WebClient wc = new WebClient(); XmlReader read = new XmlTextReader(wc.OpenRead(apiurl)); DataSet ds = new DataSet(); ds.ReadXml(read); dataGridView2.DataSource = ds.Tables[0]; DataRow[] rows = ds.Tables[0].Select(); textBox2.Text += rows[0]["totalCount"].ToString(); if (rows[0]["totalCount"].ToString() != "0") { dataGridView1.DataSource = ds.Tables[1]; } } catch (Exception ex) { } } } }