Using PowerShell 3 to connect to MySQL DB -


i've been scouring internet guides on how this, , seem tell me i'm doing already. i'm trying connect mysql database , retrieve name database based on parameter pass. problem i've been unable connect database based on guides i've seen far.

here's 1 of ways i've tried:

$connectionstring = "server=mysql.collegename.edu;uid=sconsdoc;pwd=password;database=namedatabase;"  try {     $connection = new-object mysql.data.mysqlclient.mysqlconnection     $connection.connectionstring = $connectionstring     $connection.open() } catch {     write-host "error : unable run query : $query 'n$error[0]" } {     $connection.close() } 

i following error:

error : unable run query : 'nexception calling "open" "0" argument(s): "unable connect of specified mysql hosts." exception calling "open" "0" argument(s): "unable connect of specified mysql hosts." exception calling "open" "0" argument(s): "unable connect of specified mysql hosts."[0]

i'm pretty sure i've specified correct host, , know have correct login credentials (i can @ least log in through phpmyadmin), i'm not sure what's wrong. i've followed format i've seen in several guides don't understand what's wrong here. if i'm supposed pass arguments open, they? said format i've been able find use.

"unable connect" sounds blocked connection attempt due closed/filtered port. check if can access port on remote server:

telnet mysql.collegename.edu 3306 

if database listening on non-default port need add port connection string:

server=mysql.collegename.edu;port=12345;uid=user;pwd=password;database=dbname; 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -