Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


April 2004

Powering Databases with MySQL

An open-source database server for the rest of us
RSS
Subscribe to Windows IT Pro | See More Database Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!
SideBar    Predefined MySQL Accounts

Download the Code Here

The database server market is anything but small these days. Among the many players, powerful and comprehensive open-source solutions are often overlooked. Yet several such servers compete head-to-head with commercial solutions in terms of performance and reliability.

MySQL is an SQL database server that has a dual commercial and open-source license. Essentially, if you distribute any products that use MySQL and that aren't open source (i.e., governed by the GNU General Public License—GPL), you need to license MySQL. Otherwise, MySQL is free regardless of whether you're implementing a massive network management system or deploying a Web application on the Internet.

Differences between MySQL and other solutions, such as Microsoft SQL Server, include MySQL's lack of foreign key support and the absence of support for advanced SQL constructs such as subqueries. (These features are slated for support in upcoming releases that are currently in the alpha stage.) But similarities also abound. For example, MySQL supports replication; database, table, and column security; ODBC; and scalability. MySQL also supplies command-line tools that let you work with the database server from the command line or within shell scripts, in addition to GUI management tools such as the MySQL Control Center (MySQLCC).

Installing MySQL on Your Server
To install MySQL, begin by grabbing the most recent production release—version 4.0.13 as I write this article—of MySQL for Windows from the MySQL Web site (http://www.mysql.com/downloads). After downloading MySQL, unzip the archive and, as Administrator, run setup.exe to install the MySQL program files to your computer. (You can run MySQL on Windows 95 and later, but I advise using Windows 2000 or later.) By default, the setup program installs MySQL to C:\mysql. If you're installing MySQL on a production system, strongly consider placing your data and log files on a dedicated drive as you would if you were using SQL Server. Using a separate drive for data and log files means that you won't need to worry about database growth consuming your main drive and lets you tune the file system to increase performance and disk-usage efficiency without affecting other applications.

After the installation is complete, you need to install the MySQL service. Start the WinMySQLAdmin program from the \mysql\bin subdirectory. The program asks you for a username and password. If you supply them, WinMySQLAdmin stores them in %USERPROFILE%\windows\my.ini for later use when you log in to the MySQL server. For installation purposes, however, you can simply click Cancel, and WinMySQLAdmin will open, install and start the MySQL service and will automatically minimize to the System Tray as a traffic-light icon.

Now, download MySQLCC (http://www.mysql.com/downloads/mysqlcc.html). MySQLCC is similar to SQL Enterprise Manager (SEM) in that it lets you create and drop (i.e., delete) databases and tables, specify columns and indexes, and define users and ACLs. Although MySQL comes with command-line tools, some of which you can use to manage MySQL or to dump and load databases and tables for backup purposes, administrators who are new to MySQL will find MySQLCC easier to use. (An even better tool is in the works: When MySQL Administrator becomes available, it will provide a visual interface for performing tasks such as creating databases and viewing replication status. To learn more about MySQL Administrator, go to http://www.mysql.com/products/administrator.)

In the mysqlcc-0.9.4-win32.zip distribution archive, run setup.exe or mysqlcc.msi to open the MySQL Control Center Setup Wizard. The wizard will install MySQLCC, which you can then access by clicking Start, Programs, MySQL Control Center, MySQL Control Center. When MySQLCC initially opens, it asks you to supply a name for your connection (e.g., My Connection), the host name (e.g., localhost, mysql.example.com), and login information for accessing your MySQL server. For the User Name and Password fields, specify root and a blank password, respectively. (The default password for the MySQL root user, which is similar to the SQL Server systems administrator account, is blank. To learn how to correct this security risk, see the sidebar "Predefined MySQL Accounts.") Next, click Add, then double-click your new MySQL server profile to open the connection.

Creating and Accessing a Database
Now you can do something useful: create a database. When you open your connection, you'll see MySQLCC's Console Manager window. Right-click the Databases icon, choose New Database, and enter the database name NetworkData. Later, I provide a script that uses this database to identify which servers need specific patches and to install the patches.

To create a table in the NetworkData database, double-click NetworkData, then right-click Tables and choose New Table. MySQLCC displays a window labeled Creating Table in database "NetworkData." The window contains three columns: Field Name, Allow NULL (which specifies that the field can contain a null, or empty, value), and Data Type, as Figure 1 shows. Because we'll use this database to track the patches that particular servers need, we'll store two values: the name of the server and of the application that it's running. Enter Computer in the first Field Name field and keep varchar as the Data Type. Enter App in the second Field Name field and again keep varchar as the Data Type. Click the Save icon, save the table as ComputerApps, then close the table-creation window.

   Previous  [1]  2  3  Next 


Reader Comments

You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
PsExec

This freeware utility lets you execute processes on a remote system and redirect output to the local system. ...

Friday at PASS Europe 2006

Kevin talks about the closing day of the event and shares a funny Microsoft film. ...

More fun TechEd 2005 Resources

Kevin points out some more TechEd resources ...


SQL Server and Database Whitepapers StoreVault SnapManagers for Microsoft Exchange and SQL Server

It’s What You Make IT

Database Professionals: Experience Profile and Need Gaps in Development and Database Tools

Related Events Check out our list of Free Email Newsletters!

SQL Server and Database eBooks Safeguarding Your Windows Servers

SQL Server Administration for Oracle DBAs

Taking Control: Monitoring the Windows Platform Proactively

Related SQL Server and Database Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.

Job Openings in IT


ADS BY GOOGLE SPONSORED LINKS FEATURED LINKS

Microsoft Exchange & Windows Connections event returns to Las Vegas Nov 10 - 13
Connections returns to Las Vegas for this exciting event where each attendee will receive SQL Server 2008 standard with 1 CAL. Co-located with Microsoft ASP.NET, SQL Server, and SharePoint Connections with over 250 in-depth sessions.

Free Online Event! Virtualization:Get the Facts!
Register now and attend this free, live in-depth online conference on November 13 and 20, 2008, produced by Windows IT Pro. All registrants are eligible to receive a complimentary one-year digital subscription to Windows IT Pro (a $49.95 value)!

Check Out Hyper-V Video on ITTV
Watch Karen Forster's interview on Hyper-V's performance on ITTV.net.

Ease Your Scripting Pains with the Flexibility of PowerShell!
Join MVP Paul Robichaux on December 11, 2008 at 11:00 AM EDT as he equips you with PowerShell basics in 3 introductory lessons, each followed by a live Q&A session—all on your own computer!

PASS Community Summit 2008 in Seattle on Nov 18-21
The don’t-miss event for Microsoft SQL Server Professionals. Register now and you’ll enjoy top-notch Microsoft and Community speakers and more.



Speed Up Your PC!
Try Diskeeper 2008 with InvisiTasking Free Now!

Get Protected -- Data Protection Manager 2007
Protect your virtualized environment with Data Protection Manager

Agent-less Remote Backup Service, Free 30 Day Trial
Award winning remote backup service at a competitive price with no min GB/month. Sign up Now!

ScriptLogic Cartoon Caption Contest
Submit your caption and you will be entered to win $198.42

Order Your SQL Fundamentals CD Today!
Learn how to use SQL Server, understand Office integration techniques and dive into the essentials of SQL Express and Visual Basic with this free SQL Fundamentals CD.

List Your Products in Our Technology Resource Directory
Don't miss the chance to post your free listing in this comprehensive directory for IT and developer professionals, powered by Windows IT Pro. But hurry! Deadline ends Oct. 9.
Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing