2,187
edits
m (Minor reformatting, and Meta) |
(→Connect: Made function names consistent) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
{{#widget:Widget:GoogleAdSenseSkyscraper}} | |||
To be able to interact with a MySQL database from PowerShell you need to have the MySQL .NET Connector installed first on the machine that you're going to run PowerShell from - http://dev.mysql.com/downloads/connector/net/ | To be able to interact with a MySQL database from PowerShell you need to have the MySQL .NET Connector installed first on the machine that you're going to run PowerShell from - http://dev.mysql.com/downloads/connector/net/ | ||
Line 35: | Line 36: | ||
Improved connect function with error catcher... | Improved connect function with error catcher... | ||
<source lang="powershell"> | <source lang="powershell"> | ||
function | function Connect-MySQL([string]$user, [string]$pass, [string]$MySQLHost, [string]$database) { | ||
# Load MySQL .NET Connector Objects | # Load MySQL .NET Connector Objects | ||
[void][system.reflection.Assembly]::LoadWithPartialName("MySql.Data") | [void][system.reflection.Assembly]::LoadWithPartialName("MySql.Data") | ||
Line 59: | Line 60: | ||
} | } | ||
</source> | </source> | ||
{{#widget:Widget:GoogleAdSenseSkyscraper}} | |||
= Commands = | = Commands = |