O'Reilly logo

CompTIA® Linux+ Certification, Powered by LPI, Student Manual by Axzo Press

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

1416 CompTIA Linux+ Certification, Powered by LPI
Topic B: MySQL services
This topic covers the following CompTIA exam objectives for Linux+ [Powered by
LPI] Certification, LX0-101 and LX0-102 exams.
# Objective
102.4 Use Debian package management
Install, upgrade and uninstall Debian binary packages
110.2 Setup host security
The following is a partial list of the used files, terms, and utilities:
/etc/init.d/
MySQL
Explanation
MySQL is an open source database server published by Oracle Corporation (formerly
Sun Microsytems). It is frequently used by Web site programmers for storing data that is
created or managed by a Web application. For example, an online shopping site could
store its product catalog, pricing information, inventory, sales history, and so forth in a
MySQL database.
MySQL support is probably not installed on your Linux distribution by default, unless
you specify so during installation. You can download MySQL from www.mysql.com. It
is also available as a package for most distributions.
User accounts
Connections to a MySQL server must include a user name and password. You can use
this feature to restrict access to selected databases. User A might have access to
Database A, while User B cannot access that database but can access Database B.
The default user, named root, has full control over the server. You are prompted for a
password to use with this account, if you install MySQL via a package. With other
cases, the password might be blank. You should not run a MySQL server with a blank
root password.
Web environment 1417
Do it! B-1: Installing MySQL and associated tools
Here’s how Here’s why
1 Use Synaptic Package Manager to
mark the following packages and
their dependencies for installation:
mysql-server
php5-mysql
phpmyadmin
The mysql-server package installs both the
server and client tools, along with various
libraries. The php5-mysql package enables PHP
programs to access MySQL services. And,
phpmyadmin is a PHP-based Web tool for
managing your MySQL databases.
Apply the changes
2 In the New Password for the
MySQL “root” user box, enter
password123
Click Forward
Enter the password again and
click Forward
3 In the Web server to reconfigure
automatically dialog box, check
apache2
If prompted.
Click Forward
4 Close Synaptic Package Manager
When you’re done.
1418 CompTIA Linux+ Certification, Powered by LPI
MySQL configuration
Explanation
MySQL configuration settings are kept in a file named my.cnf. Multiple versions of this
file may exist on a system. The /etc/mysql/my.cnf file sets global MySQL options.
Stored in a user’s home directory, the ~/.my.cnf file (note the added period which makes
the file hidden), sets user-specific configuration options.
In either file, you can set various MySQL parameters that manage memory usage, the
network port to listen on, the user account associated with MySQL operations, and so
forth.
By default, MySQL connections are made over port 3306. A MySQL client can connect
to a MySQL server using its IP address or FQDN, as long as it specifies the correct port.
This means you could have your Web server on one computer and your MySQL
database server on another server, which together would power your e-commerce Web
site.
Do it!
B-2: Examining the MySQL configuration files
Here’s how Here’s why
1 Open a terminal window
If necessary.
2 Enter cd /etc/mysql
3 Enter less my.cnf
To view the global MySQL configuration file.
Under the [client] heading,
examine the port= line
This line defines the port over which the
MySQL clients communicate.
Press v
Under the [mysqld] heading,
observe the various settings
These settings control the MySQL server
(daemon), including the user under which the
daemon runs, the port it listens to, and so forth.
4 Quit less
Web environment 1419
phpMyAdmin
Explanation The phpMyAdmin program is a PHP-based Web application that you can use to manage
your MySQL server. You load it via your browser. With it, you can set some MySQL
server operational parameters. However, its main purpose is to enable you to manage
your databases and their contents.
Many Web hosting companies provide MySQL support and include phpMyAdmin as
the means to manage your databases. phpMyAdmin is an open source project, and the
program is licensed under the GPL. Visit www.phpmyadmin.net to download
phpMyAdmin or get more information about the project. An example of the tool is
illustrated in Exhibit 14-5.
Exhibit 14-6: The phpMyAdmin tool, showing the default mysql database

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required