Tuesday, March 11, 2014

How to run .bat files from Visual Studio

Here's a pretty nifty way to run .bat files directly from Visual Studio.

http://stackoverflow.com/questions/5605885/how-to-run-a-bat-from-inside-the-ide

I can now run .bat files without leaving Visual Studio just by right-clicking the .bat file and select 'Run bat file'. 




Thursday, April 11, 2013

MySQL Workbench export problem - "mysqldump.exe is version 5.5.16" will not work with version 5.6.10 of MySQL Server"

Got this error today when trying to export a database hosted on MySQL Server 5.6.10 using MySQL Workbench 5.2.47.















Opening up a command-prompt and comparing the mysqldump.exe versions between MySQL Server and MySQL Workbench showed following














Solution
Copied the mysqldump.exe (version 5.6.10) from the MySQL Server 5.6 installation folder and replaced the mysqldump.exe (version 5.5.16) at the MySQL Workbench 5.2 CE folder.

Export now works like a charm again.

Wednesday, April 10, 2013

Changing MySQL root password

  1. Launch a command-prompt. 
  2. Navigate to the bin folder of your MySQL installation.
    (e.g. C:\Program Files\MySQL\MySQL Server 5.6\bin)
  3. Start the MySQL command-line interface via
    mysql -u root -p 
  4. You will be prompted to type your existing root password.
  5. After a successful login you should see a prompt saying 'mysql>'. 
  6. Enter following command to change password
    SET PASSWORD FOR root@localhost=PASSWORD('new_passw_goes_here');
  7. Volia!

Tuesday, January 15, 2013

AWS, ColudWatch and monitoring of available diskspace

We have experienced some disk space related hick-ups in our AWS production environment over the last 3 months.

Some of them were caused by IIS logging (enabled by default when setting up a new website) and others originated from custom trace-logging being left turned on by mistake.

To prevent this from ever happening again we wanted to setup an automatic monitoring and notification mechanism that sent us an email if  the available disk space should drop below a certain threshold on any of the app- or db-servers.

Easy enough...just setup 2 alarms in the AWS CloudWatch and have another cup of coffee I thought.
Doh!
CloudWatch does not have any metrics on the available disk space...

....but they have an API that allows us to create custom metrics and push data into CloudWatch.

Before firing up Visual Studio I decided to skim Google Bing for what's already out there (we don't want to re-invent the wheel...or rather the guys/customer paying our bills don't...). I can hardly be the first one facing this problem right?

Right!
Here's a great open source project that perfectly fit our needs:
https://github.com/eleven41/CloudWatchMonitor
(or if you prefer the binaries: http://www.eleven41.com/Labs/cloudwatch-monitor-for-windows)

The monitor app runs either as a command-line program (nifty to start with to make sure you get the .config settings right) or as a Windows service.

Kudos to Eleven41 for a great solution (and for opensourcing the code) !





Sunday, December 9, 2012

What time and timezone does a MySQL instance use?

select CURRENT_TIMESTAMP();
select @@global.time_zone;

Wednesday, December 5, 2012

Complete uninstall/removal of MySQL

Simply uninstalling MySQL using the Windows standard Programs and Features->Uninstall is not enough if you want to completely remove MySQL from the machine.

Here are the steps required:
  • Uninstall MySQL using the standard Windows program uninstaller
  • Delete C:\Program Files\MySQL
  • Delete C:\Program Files (x86)\MySQL
  • Delete C:\ProgramData\MySQL
  • Delete from any Users' AppData folders. Example: C:\Users\rdoverby\AppData\Roaming\MySQL
  • Reinstall MySQL

Saturday, December 1, 2012

Dev tools 2013

Mr. Hanselman has one...so should you.
Here's mine anno 2013.

*) Oh...I'm still on Win 7 by the way...

General tools
Dev tools
Firefox plugins/add-ons