Installing MySQL Server


Installing MySQL is relatively painless. First, you need the installation program for MySQL, which is available on the companion CD. You can also download the latest version from http://www.mysql.com.

Note

If you choose to install MySQL in a different folder than the default (C:\MYSQL) or you wish to start MySQL on NT/Win2000 as a service, you need to create a file named MY.CNF in the root of your C:\ drive with the following information in it (or append the following information to either \Windows\my.ini or \winnt\my.ini, depending on your OS):

[mysqld]  basedir=E:/installation-path/  datadir=E:/data-path/

After you have installed MySQL, the directory will contain the my-example.cnf file. You can use this as a template to create your own my.cnf file.

Once you start the installation, it will first ask you which type of setup you would prefer: typical, compact, or custom installation. Here we will select the Typical option, as it will install all the components that we require in order to work with MySQL.

After selecting Typical, press the Next button and the installation process will be automatically completed.

Now that we have MySQL installed, we will first browse the directory so we can see what it has installed for us.

All we really have use for here (with respect to Java) is the bin directory, which contains the MySQL server and client executables, and the docs directories, which contain the HTML version of the MySQL manual.

Note

An Adobe PDF version of the MySQL manual has also been supplied on the companion CD-ROM. We find this easier to read, but you will also require the free program Adobe Acrobat Reader to view this manual, which is available to download at http://www.adobe.com/products/acrobat/readermain.html.

Let's now take a look in the bin directory and see what is of use to us there. As you can see, there are many executables in this directory; some are daemons (i.e., the MySQL server), and some are console-based clients to access the MySQL server with.

Note

A daemon is simply a program or process that sits idly in the background until it is invoked to perform its task.

mysqld.exe is the best server to use when developing software. The others are used more to adjust speed and support extra features. Here are each of the different server versions and their uses:

If you do not fully understand the meaning of the different versions, simply stick to using mysqld.exe, as you probably will not require the others.

The executable mysql.exe is a console-based client, which is used to interact with the MySQL server by means of the SQL language.

The obvious thing to do now is run a MySQL server so we can access it via the client. The executable we want for this is called mysqld.exe. There might be cases when the debug version of MySQL is better (information about errors, etc.). But in general, one version is as good as the other for running the MySQL server in the background. If you now execute this, a black window will appear for a very short period of time and disappear. You can check that the MySQL server is running by hitting Ctrl, Alt, and Delete at the same time to bring up the list of tasks that are currently running in Windows.

Note

In Windows NT and Windows 2000, Ctrl+Alt+Del produces a different window than in Windows 98. Windows XP also has a different view.

Windows NT and Windows 2000 have a slightly different approach when starting the MySQL server.

Note that you may have more on this list if you are running other programs. Also, the Mysqld daemon may not be at the bottom of the list.

Now, if we try to run the MySQL console client (mysql.exe), we can see that it will connect to the MySQL server and display a welcome message and then await input.

Now we are able to connect to the MySQL server from the MySQL console client. One problem is that every time we restart Windows, the MySQL server will not be restarted, meaning we would have to manually go to the directory and run the mysqld-opt.exe every time we start Windows. This can be solved by adding the MySQL server as a service that is started every time Windows is loaded up.

Legal Disclaimer

Our website is not responsible for the information contained by this article. Webworldarticles.com is a free articles resource thus practically any visitor can submit an article. However if you notice any copyrighted material, please contact us and we will remove the article(s) in discussion right away.


This article was sent to us by: George Ionescu at 01042008

Related Articles

1. Joining SQL Tables
When accessing information within database tables, we may sometimes need to look at data from two or more different tables, as we saw in the previous example. There is ...

2. Basic SQL syntax: Creating and Modifying tables and databases
This tutorial shows basic syntax and commands and of the SQL language. Creating and Dropping Databases First, let's see what databases already exist ...

3. Introduction to SQL
SQL is an acronym for Structured Query Language and is the standard language for interaction with databases. SQL is both an ISO (International Organization for Standard...

4. What Is a Database
A database is simply an organized collection of information. It allows many different types of data to be stored and retrieved in a highly efficient manner. Info...

5. Data Entry and the Various Industries that use this Service
Group of people flooding Excel sheets with alpha and numeric characters... spontaneous sound of pressing keyboards... these are what you will find in data entry service. Fr...

6. Different Forms and Variations of Data Entry
Data entry is the procedure of feeding data into spreadsheets and database. It can either be done automatically by a machine that keeps on adding data in the database, or m...

7. How Data Entry Services Benefit Industries And Why It Is Essential
It is irrelevant whether you have a small business or a global empire - information is an asset in any kind of business. And when it is business, everything comes down to p...