Comments on: Powershell: Run MySQL Querys with Powershell https://www.thomasmaurer.ch/2011/04/powershell-run-mysql-querys-with-powershell/ Cloud and Datacenter Blog focusing on Microsoft Azure Wed, 13 Apr 2022 18:05:17 +0000 hourly 1 https://wordpress.org/?v=6.4.1 By: Kei https://www.thomasmaurer.ch/2011/04/powershell-run-mysql-querys-with-powershell/#comment-874663 Wed, 13 Apr 2022 18:05:17 +0000 http://www.thomasmaurer.ch/?p=1826#comment-874663 Thank you for your posting, this works great locally. I am just wondering if the script still works for a remote server such as mywebsite.com. I am getting an error when I enter my remote server name instead of ‘localhost ‘ and not sure if this is a firewall issue or something else.

]]>
By: Thomas Maurer https://www.thomasmaurer.ch/2011/04/powershell-run-mysql-querys-with-powershell/#comment-827491 Sat, 07 Nov 2020 11:55:25 +0000 http://www.thomasmaurer.ch/?p=1826#comment-827491 In reply to DataTraveler1.

you’re welcome, happy it still helps people :)

]]>
By: DataTraveler1 https://www.thomasmaurer.ch/2011/04/powershell-run-mysql-querys-with-powershell/#comment-827394 Sat, 07 Nov 2020 05:23:36 +0000 http://www.thomasmaurer.ch/?p=1826#comment-827394 Thanks a lot for posting this even though it was many years ago. :)

]]>
By: Stephen Wilson https://www.thomasmaurer.ch/2011/04/powershell-run-mysql-querys-with-powershell/#comment-640744 Wed, 10 Feb 2016 11:18:50 +0000 http://www.thomasmaurer.ch/?p=1826#comment-640744 Thank you!

]]>
By: Neale https://www.thomasmaurer.ch/2011/04/powershell-run-mysql-querys-with-powershell/#comment-637659 Mon, 28 Dec 2015 21:52:31 +0000 http://www.thomasmaurer.ch/?p=1826#comment-637659 change the line: $dataSet.Tables[“data”] | Format-Table
to –> return $dataSet.Tables[“data”]
then the answer set is returned as a system.array object…

]]>
By: John https://www.thomasmaurer.ch/2011/04/powershell-run-mysql-querys-with-powershell/#comment-622337 Thu, 03 Sep 2015 07:29:49 +0000 http://www.thomasmaurer.ch/?p=1826#comment-622337 Hi,
Awesome script and I have this working but I am unable to get the
‘SELECT last_insert_id()’

working so that I can return id of the row I just inserted. I need this so that I can insert this into other tables for references.

When I run an insert command the insert works. But when I try and grab the last inserted row it returns ‘System.Data.DataRow’

./Mysql.ps1 -Query “insert into foo (blah,blah,blah2) values (‘$one’,’$two’,’$three”)”

$id = ./Mysql.ps1 -Query “SELECT last_insert_id()”

Have you any idea how I can get the values of the last id?

]]>
By: Michael https://www.thomasmaurer.ch/2011/04/powershell-run-mysql-querys-with-powershell/#comment-561648 Fri, 28 Nov 2014 20:26:03 +0000 http://www.thomasmaurer.ch/?p=1826#comment-561648 Very helpful post.
I’m building script in PS with Active Directory output and INSERT info MySQL Table row by row.
Can you help me with this? I already did the AD output but can’t connect to MySQL DB to make the INSERT.

]]>
By: Chris https://www.thomasmaurer.ch/2011/04/powershell-run-mysql-querys-with-powershell/#comment-20236 Thu, 24 Oct 2013 13:12:19 +0000 http://www.thomasmaurer.ch/?p=1826#comment-20236 Hey,

thx for the Script! This is the first one how worked at the firsttime without any errors!

thx

cheers

Chris

]]>