docs.roxen.comView this page in a printer friendly mode
DocsRoxen2.1TutorialsDatabase Tutorial
Copyright  2001, Roxen Internet Software
Suggestions, comments & compliments

Installing MySQL
Building a Sample Database
The query() function
The big_query() function
SQL Syntax
Features Missing from MySQL
Insertion Syntax
The tablify Container
The Business Graphics Module
The emit and sqlquery Tags
Database Creation
Creating Tables

Installing MySQL

If you have already MySQL installed on your system, you may skip this chapter.

Also, if you're running one of the various Linux distributions, there's a chance that you can find precompiled packages for your distribution. Be warned, if your distribution uses an RPM package format (Red Hat, Mandrake, SuSE, Caldera and others use this), you will need to install a group of packages (MySQL, MySQL-client, MySQL-devel). The same probably applies to Debian-based distributions (Debian, Corel Linux,...).

You can download the sources for the MySQL server from the MySQL site. Be sure to check the licensing terms: MySQL is free software as in "Free speech", not always also as in "Free beer".

Unpack the archive you downloaded:

$ gzip -dc mysql-version_number.tar.gz | tar xvf -
$ cd mysql-version_number

Decide where you wish to install it: usually it will be in /usr/local/mysql or /usr/local. During this tutorial we'll assume the former. Detailed installation instructions can be found in the INSTALL-SOURCE file in the mysql distribution.

You can then run

$ ./configure --help

if you wish to get an informative help for available build-time configuration options.

The recommended configuration command line (with gcc) is

$ ./configure --without-debug --without-bench \
  	      --prefix=/usr/local/mysql \
  	      --enable-thread-safe-client \
  	      --enable-assembler \
  	      --with-mysqld-ldflags='-s' \


$ make

- and if it compiles successfully,

$ make install

will install the package, while

$ scripts/mysql_install_db

prepares the bootstrap (empty) databases.

You'll probably want to have the mysql daemon started at system startup. To do so, you can look at the file in support-files/mysql.server. How to use it, however, depends on your system. If you aren't the system administrator, ask for his help.

The standard server-administrator name is "root", with an empty password. To change the password, issue the command:

$ mysqladmin password *new password*

Not changing the adminstrator password is a serious security hazard.