35.2. The MySQL Database Server Module

This module allows you to create databases, tables, and fields, edit records, and manage MySQL users through a simple web interface. Its icon can be found under the Servers category, and when you click on it, the module's main page will display a table of icons for existing databases as shown in Figure 35.1 (assuming MySQL is installed and running).

Figure 35.1. The MySQL Database Server module main page.


If the MySQL server process is not running, the message MySQL is not running on your system will appear on the main page instead. To start it, just hit the Start MySQL Server button at the bottom of the page. If you want to make use of the database in future, use the Bootup and Shutdown module (covered in Chapter 9) to have it started at boot time. On Linux systems, the MySQL package will probably include a mysql action that you can easily enable.

If the database server is running but Webmin does not know the correct password to log in to it with, the main page will display a MySQL Login form instead. You should enter the administration username into the Login field (usually root), and the corresponding password into the Password field. Even though it is possible to enter the username and password for any MySQL user, non-root users cannot perform tasks such as creating databases and tables, so neither will the module be able to.

By default, the module is configured to log in with the username and password that the MySQL package for your distribution uses by default. Only if you have changed it manually or through Webmin will the MySQL Login page appear.

If the database server is not installed at all on your system, the main page will display an error message like The MySQL client program /usr/bin/mysql was not found on your system. Check your distribution CD or website for all MySQL-related packages and install them using the Software Packages module. Often there are several, named something like mysql, mysql-client, mysql-server and mysql-devel. Each Linux distribution seems to use a different set of packages, so make sure you install them all.

On FreeBSD and NetBSD, the module expects the MySQL package for those operating systems to be installed. On other UNIX variants, it assumes that you have compiled and installed MySQL from the source code distribution, available from www.mysql.com/.

If the module complains that it cannot find the mysql program even though you have it installed, you will need to adjust the paths that it uses. This can happen if you installed it from the source instead of using the package that comes with your Linux distribution. See Section 35.14 “Configuring the MySQL Database Server Module” for details.

The MySQL module uses SQL commands to perform actions like creating tables, adding fields, and editing records. Webmin must connect to the database server to execute these commands, which can be done in one of two ways. It can either run the mysql command with the correct parameters and parse its output or use the Perl DBI library to connect directly.

The former method is always available, because the mysql command is always installed when the database server is. It is not totally reliable, however, as certain kinds of table data produce output that cannot always be parsed. For this reason, you should install the DBI and DBD::mysql Perl modules. If either is missing, a message will be displayed at the bottom of the main page prompting you to install one or both by clicking on a link. This will take you to a page in the Perl Modules module (covered in Chapter 27) where DBI and/or DBD::mysql are downloaded and installed for you.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.159.223