¿ù°£ Àα⠰Խù°

°Ô½Ã¹° 256°Ç
   
Connecting to MySQL from PowerShell
±Û¾´ÀÌ : ÃÖ°í°ü¸®ÀÚ ³¯Â¥ : 2012-05-11 (±Ý) 10:24 Á¶È¸ : 7734
±ÛÁÖ¼Ò :
                                
Âü°í : http://markalexanderbain.suite101.com/connecting-to-mysql-from-powershell-a117797

Getting Started with Powerscript and the MySQL .NET Connector

1. Download Connector .net


¿¹Á¦¿¡¼­´Â ¿ø°Ý¿¡¼­ ·Î±ä½Ãµµ...
2. example.ps1
[void][System.Reflection.Assembly]::LoadWithPartialName("MySql.Data")
$connectionString = "server=XXXX;uid=XXX;pwd=XXXX;database=XXXX;"


$connection = New-Object MySql.Data.MySqlClient.MySqlConnection
$connection.ConnectionString = $connectionString
$connection.Open()


$sql = "select * from TABLE_NAME where UnixTimeStamp='1336683600'"
$command = New-Object MySql.Data.MySqlClient.MySqlCommand($sql, $connection)

$dataAdapter = New-Object MySql.Data.MySqlClient.MySqlDataAdapter($command)
$dataSet = New-Object System.Data.DataSet

$recordCount = $dataAdapter.Fill($dataSet, "sample_data")

$dataSet.Tables["sample_data"]
$connection.Close()


3. ½ÇÇà°á°ú





À̸§ Æнº¿öµå
ºñ¹Ð±Û (üũÇÏ¸é ±Û¾´À̸¸ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.)
¿ÞÂÊÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.
   

 



 
»çÀÌÆ®¸í : ¸ðÁö¸®³× | ´ëÇ¥ : ÀÌ°æÇö | °³ÀÎÄ¿¹Â´ÏƼ : ·©Å°´åÄÄ ¿î¿µÃ¼Á¦(OS) | °æ±âµµ ¼º³²½Ã ºÐ´ç±¸ | ÀüÀÚ¿ìÆí : mojily°ñ¹ðÀÌchonnom.com Copyright ¨Ï www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.