Aug 18 2009

Automated MySQL Install On Windows

If you need to install MySQL databases on a number of machines with roughly the same configuration then it becomes extremely tedious to run the installer wizard on each machine. You can download the MySQL server as a msi package which allows you to install with the MSIEXEC DOS command in windows hands free. To install all the necessary files for MySQL to run you need to type this command at the console:

msiexec /qn /i mysql-essential-5.1.37-win32.msi INSTALLDIR=C:\MySQL

The ‘/qn’ switch makes this install quiet. In this example I chose ‘C:\MySQL’ as the install directory. Feel free to replace that path with whatever you choose.

Just because MySQL is installed and has all the appropriate files registered doesn’t mean that it’s useful. You will probably want it to run as a service, have it listen on a certain port, and have a root user already set up. This can be done with the MySQLInstanceConfig.exe program, although the arguments are a little more involved.

C:\MySQL\bin\MySQLInstanceConfig.exe -i -q 
"-pC:\MySQL\bin" "-tC:\MySQL\my-template.ini" 
"-cC:\MySQL\my.ini" -v5.1.37 

The entire string above must be run as one line. If you just copy and paste then the console will error out. Most of the arguments above are straight forward if you’ve ever configured a MySQL server before but just in case I’ve detailed the parameters below.

-n product name
-p path of installation (no \bin)
-v version

-i (install instance)
-r (remove instance)
-s (stop instance)
-q (be quiet)
-lfilename (write log file)

When launched manually, these can also be submitted
-t<.cnf template filename>
-c<.cnf filename>

Use the following options to define the parameters for the configuration file generation.
AddBinToPath={yes | no}
DatabaseType={MIXED | INNODB | MYISAM}
ConnectionUsage={DSS | OLTP}
SkipNetworking={yes | no}
StrictMode={yes | no}

So if you use the example above you will get a basic mysql installation. When I used these commands I put them in a batch file followed by this command:

mysql –user=user_name –password=your_password db_name < create_database_and_tables.sql The ‘create_database_and_tables.sql’ obviously has all the sql code to create the MySQL databases and tables that are needed. The batch file installed, configured, and structured my MySQL databases. I spent awhile yesterday looking for a post like this so hopefully this saves someone some time.


Aug 15 2009

Windows Batch File Without Popup Console

Sometimes you need to schedule a batch file to run some script periodically on a windows server. I found myself having to run one fairly often and it would always pop up that annoying console window whenever I was in the middle of typing something. This sent me searching for a way to run the script without the pop up console window. There was a few ways to do this but I didn’t want to download and install any other software so I went the vbscript route. Here is what I did.

First create a file and call it ‘somefilename.vbs’ and put it in the same directory as the batch file that you want to run.
Next put this code in it :

Dim oShell
Set oShell = WScript.CreateObject ("WScript.Shell") "my-batch-file.bat", 0, False
Set oShell = Nothing

Now when you set up the windows scheduler you want to point it at the ‘.vbs’ file and not the ‘.bat’ file. That seemed to be the easiest and quickest way to get rid of the console popup when running a batch file on a windows server. If anyone has another method that doesn’t require the creation of a new file I would like to hear it. You could always do some reading on vbscript and just code everything in vbscript and not use a batch file at all but I didn’t bother.


May 25 2009

Useful Windows Networking Tools

I spent awhile after work today trying to figure out why my mapped drives in windows weren’t working. I kept getting “MSHOME is not accessible” which was annoying because I wanted to watch some cartoons. Turns out that I booted my Linux box first and it became the master browser so I had to turn off my samba server and allow the windows xp machine to become the master browser. I found this out by using these commands and tools.

For informational purposes theres
net config server
net config workstation
ipconfig /all

Those commands can be helpful at times but I found that they do not give enough information about the computer browsing services.

I found a tool called Browstat that you can download for free that gives you the clues to properly debug your windows network. Once you’ve downloaded that file and put it in your C:\Windows folder you’re going to want to open up a command window and type: browstat status.
This will give you most of the information that you need to debug your network.

If anyone knows about any other great networking tools like browstat I would really like to know about them.


May 21 2009

Best Windows Hotkey

I found a couple new windows hotkeys that I don’t think I’ve ever used before.  Decided to put up a poll to see what most people use on a day to day basis. All the useful windows hotkeys with explanations are right under the poll.

Whats the Best Windows Hotkey?

View Results

Loading ... Loading ...

CTRL and A             Select All
CTRL and C             Copy
CTRL and F             Find
CTRL and G             Go To
CTRL and N             New
CTRL and O             Open
CTRL and P             Print
CTRL and S             Save
CTRL and V             Paste
CTRL and X             Cut
CTRL and Z             Undo
CTRL and F4             Close
CTRL+ESC             Start menu

ALT+ENTER             View Properties
ALT+F4                 Close Item
ALT+SPACEBAR             Open Shortcut Menu
ALT+TAB             Switch Programs
ALT+ESC             Cycle Through Programs

F1 key                 Help
F2 key                 Rename in Windows Explorer
F3 key                 Search (Same as CTRL and F)
F4 key                 Display Address Bar
F5 key              Update/Refresh
F10 key             Activate Menu Bar

Windows Key             Display or hide the Start menu
Windows Key+BREAK         Display the System Properties dialog box
Windows Key+D             Display the desktop
Windows Key+M             Minimize all of the windows
Windows Key+SHIFT+M         Restore the minimized windows
Windows Key+E             Open My Computer
Windows Key+F             Search for a file or a folder
Windows Key+CTRL+F         Search for computers
Windows Key+F1             Display Windows Help
Windows Key+ L             Lock the keyboard
Windows Key+R              Open the Run dialog box
Windows Key+U             Open Utility Manager

TAB                 Move forward through the options
SHIFT+TAB             Move backward through the options
CTRL+TAB             Move forward through the tabs
CTRL+SHIFT+TAB             Move backward through the tabs

If I missed any then let me know


Jan 11 2009

We Screwed Up Windows 7 Beta, So Unlimited Downloads For All

If you haven’t grabbed your free beta copy of Windows 7 yet, there’s good news: you’ve now got 2 weeks to do so. Microsoft made the offer Saturday evening after what started as a well received offer turned into a potential PR disaster for Microsoft.


Jan 11 2009

New Google Favicon Deja Vu All Over Again?

theodp writes “Last June, Google rolled out a new favicon, the small branding icon that graces your URL bar when you visit Google. Which, as it turned out, bore a striking similarity to Garth Brooks’ Circle-G logo. Well, Google went back to the drawing board and has come back with a new favicon, which it says was inspired by — not copied from, mind you — its users’ submitted ideas. Some are also seeing inspiration elsewhere for the new favicon, which consists of white ‘g’ on a background of four color swatches. Take the AVG antivirus icon, for instance. Or everybody’s favorite memory toy, Simon. Or — in perhaps the unkindest cut of all — the four-color Microsoft Windows logo, shown here with a superimposed white ‘7’. Anything else come to mind?” What comes to mind for me is just how obsessed many people are with the Google favicon.

Read more of this story at Slashdot.


Jan 11 2009

Ubuntu and Its Leader Set Sights on the Mainstream

The notion of a strong Linux-based competitor to Windows and, to a lesser extent, Apple’s Mac OS X has been an enduring dream of advocates of open-source software. They champion the idea that software that can be freely altered by the masses can prove cheaper and better than proprietary code produced by stodgy corporations.


Jan 10 2009

Windows 7 beta now available

Microsoft has apparently decided that it has enough server capacity and has made the code for the Windows 7 beta available.


Jan 10 2009

Windows 7 Beta Released To Public After Delay

Z80xxc! writes “The Windows 7 Beta release is now available for download by the general public, in 32-bit and 64-bit flavors. Microsoft had previously announced availability around 3 PM PST on Friday, but after unexpected numbers of people interested in the download, had to postpone it to add more servers.”

Read more of this story at Slashdot.


Jan 10 2009

Windows 7 Beta Rollout Fails Without BitTorrent

Microsoft ran into major bandwidth problems when they released the latest Beta of Windows 7 to the public. The company decided to delay the release while they added some more servers, citing “very heavy traffic”. If they had only used BitTorrent, this heavy traffic would have actually speeded up distribution, instead of slowing it down.