#配置
$mysqldllpatch='C:\Users\Administrator\Documents\v2.0\MySql.Data.dll'
$ConnectionString1="host=localhost;uid=root;pwd=passwd;database=dbname"
$jsonfile="C:\webservice\apache-tomcat-7.0.59\webapps\app\WEB-INF\classes\payprice.json"
#初始化数据库连接
[void][system.reflection.Assembly]::LoadFrom($mysqldllpatch)
$connection1 = New-Object MySql.Data.MySqlClient.MySqlConnection
$connection1.ConnectionString = $ConnectionString1
$command1 = New-Object MySql.Data.MySqlClient.MySqlCommand($sql1,$connection1)
$command1.CommandTimeout=600
$da1=New-Object MySql.Data.MySqlClient.MySqlDataAdapter($command1)
#数据库查询
$command1.CommandText="SELECT game_id,amount,game_coin,coin_bonus FROM `gamebox_game_payment_type_price` where payment_type_id=12;
SELECT game_id,amount,game_coin,coin_bonus FROM `gamebox_game_payment_type_price` where payment_type_id=13;
SELECT ga
powershell mysql转json(Utf8NoBom)
最新推荐文章于 2024-07-21 13:08:34 发布
本文介绍了如何使用PowerShell从MySQL数据库中检索数据,并将其转换为UTF8NoBom格式的JSON文件,详细阐述了相关命令和步骤。
摘要由CSDN通过智能技术生成