powershell 链接 mysql

[void][System.Reflection.Assembly]::LoadWithPartialName("MySql.Data")

 
 

$connectionStr = "Server=localhost;Uid=root;Pwd=123456;database=dbname;"

$querysql = "select * from tablename ;"

 
 

$connection = New-Object MySql.Data.MySqlClient.MySqlConnection

$connection.ConnectionString = $connectionStr

$connection.Open()

$command = New-Object MySql.Data.MySqlClient.MySqlCommand($querysql, $connection)

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

$dataSet = New-Object System.Data.DataSet

$recordCount = $dataAdapter.Fill($dataSet)

$dataSet.Tables[0]

微信扫一扫,分享到朋友圈

powershell 链接 mysql
返回顶部

Optimized by WPJAM Basic

显示

忘记密码?

显示

显示

获取验证码

Close