0

I'm trying to configure ODBC driver to connect to MySQL database in Windows Server 2016. Usually we are configure ODBC Data Source configuration in MYSQL Connector by manually like below image. datasource-configuration-1

and will select some connections and cursor/results as below

datasource-configuration-2

Finally select OK to make available in System Data Sources. Now i trying to configure this things by powershell script or commands. However, i tried one method as below.

$odbcname="TestModel"
$mysqlserver="example.rds.amazonaws.com"
$mysqldb="TestModel"
$OdbcDriver = Get-OdbcDriver -Name "MySQL ODBC 5.2 Unicode Driver" -Platform 32-bit
Add-OdbcDsn -Name $odbcname -DriverName $OdbcDriver.Name -Platform 32-bit -DsnType 
System -SetPropertyValue 
@("Server=$mysqlserver",Trusted_Connection=Yes","Database=$mysqldb")

No luck. I had a look at more documents. But i couldn't able to achieve this. I need to configure all the things such as server name, user name & password, then select the database and configure connections and results by using powershell script. Can any one please advice on this?

4

0 回答 0