Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Linux Timesaving Techniques For Dummies.pdf
Скачиваний:
59
Добавлен:
15.03.2015
Размер:
15.98 Mб
Скачать

Building a MySQL Server 329

The MySQL software is distributed under a dual licensing scheme. If you’re not redistributing MySQL as part of a closed-source package, you can use MySQL under the terms of the GNU General Public License. If you are redistributing MySQL as part of a proprietary software package, or you want warranty support from MySQL AB, you have to purchase a license. We’re not attorneys, so please see the MySQL Web site (www.mysql.com) for the official license policies.

Building a MySQL Server

If you’ve slogged through the installation instructions at the MySQL Web site, you’ll be happy to know that creating a MySQL server on Linux is surprisingly easy. The MySQL team has followed all the instructions on your behalf and wrapped everything up in a tidy RPM package that does all the dirty work for you.

Installing the necessary packages

To create a MySQL server on your computer, use your distribution’s installer to install the MySQL server, MySQL client, and all necessary dependencies.

If you’re a Mandrake user, use Rpmdrake and select Server Database Other MySQL. Rpmdrake automatically installs the MySQL client and a whole slew of dependencies for you.

If you’re a Fedora user, use Add/Remove Packages and scroll down to the Servers section. Click the Details link next to SQL Database Server and choose MySQL-server. Fedora automatically resolves all dependencies and installs the MySQL client software for you.

SuSE fans should use YaST2 to install MySQL. You’ll find MySQL in Productivity Databases Servers. Like the Fedora and Mandrake installers, YaST2 will install the MySQL client software and any dependencies.

Starting the MySQL server

Before you can use MySQL, you need to start the MySQL server:

1. Open the Main Menu and choose System

Services (or, if you’re using GNOME, choose System Settings Server Settings Services).

2. Enter the root password if prompted.

3. Scroll through the list of services (in the leftmost column) and find the service named mysqld.

4. Check the box to the left of mysqld and then click Save (on the toolbar).

5. Click Start (also on the toolbar).

A message appears confirming that the mysqld service started successfully.

6. Click OK and close the Service Configuration window.

You must hold superuser privileges to start the MySQL server. Open a terminal window and give yourself the required privileges with the su - command.

To start the MySQL server on a Mandrake system, type in the following command:

# /etc/init.d/mysql start

On a SuSE computer, use this command:

# /usr/sbin/rcmysql start

If you’re running Fedora, use the following command:

# /etc/init.d/mysqld start

MySQL is up and running. The first time you start the MySQL server, it creates the server environment and an empty database named test.

The data files for your MySQL database are stored in the /var/lib/mysql directory. For convenience, we refer to that directory as $MYSQL.

Соседние файлы в предмете Операционные системы