This document provides instructions for downloading, installing, configuring, and using the MySQL database on Linux. It explains that MySQL is an open-source database that is fast, powerful, and works with many programming languages. The document then outlines steps for downloading the MySQL RPM files, installing them on Linux, verifying the installation, setting the root password, starting the MySQL server at boot, and executing basic SQL commands.
4. MySQL Database -
Popular:
• an open-source license - nothing to pay
to use it.
• very powerful program
• handles a large subset of the
functionality of the most expensive and
powerful database packages
MySQL on
Linux
4
5. MySQL Database -
Popular:
• uses a standard form of the well-known
SQL data language.
• works on many operating systems
• with many languages including PHP,
PERL, C, C++, JAVA, etc.
MySQL on
Linux
5
6. MySQL Database -
Popular:
• works very quickly and works well even
with large data sets.
• very friendly to PHP - for web
development.
• supports large databases - up to 50
million rows or more in a table.
MySQL on
Linux
6
7. MySQL Database -
Popular:
• default file size limit for a table is 4GB –
[a theoretical limit of 8 million terabytes
(TB)].
• customizable - allows programmers to
modify the MySQL software to fit their
own specific environments.
MySQL on
Linux
7
8. Downloading MySQL
• All downloads for MySQL are located
at MySQL Downloads
1)http://www.mysql.com/downloads
2)http://dev.mysql.com/downloads/mysql
/5.1.html
MySQL on
Linux
8
9. Downloading MySQL
• Pick the version and the platform of MySQL
Community Server you want.
downloaded the “Red Hat Enterprise Linux 5 RPM
(x86)”
1. MySQL-client-community-5.1.25-0.rhel5.i386.rpm
2. MySQL-server-community-5.1.25-0.rhel5.i386.rpm
3. MySQL-devel-community-5.1.25-0.rhel5.i386.rpm
MySQL on
Linux
9
10. Downloading MySQL
• The recommended way to install MySQL on a
Linux system is via RPM. MySQL AB makes the
following RPMs available for download on its
web site:
1.MySQL - The MySQL database server, which
manages databases and tables, controls user
access, and processes SQL queries.
MySQL on
Linux
10
11. Downloading
MySQL
2. MySQL-client - MySQL client programs,
which make it possible to connect to and
interact with the server.
3. MySQL-devel - Libraries and header files that
come in handy when compiling other
programs that use MySQL.
4. MySQL-shared - Shared libraries for the
MySQL client.
5. MySQL-bench - Benchmark and performance
testing tools for the MySQL database server.
MySQL on
Linux
11
12. Downloading
MySQL
The MySQL RPMs listed here are all built
on a SuSE Linux system, but they'll
usually work on other Linux variants
with no difficulty.
MySQL on
Linux
12
13. Downloading
MySQL• Remove the existing default MySQL that
came with the Linux distribution:
Do not perform this on an system where the MySQL database
is getting used by some application
MySQL on
Linux
13
14. 14
• Now, follow the following steps to
proceed for installation:
• Login to the system using root user.
• Switch to the directory containing the
RPMs:
• Install the MySQL database server by
executing the following command.
Remember to replace the filename in
italics with the file name of your RPM.
Installing
MySQL
16. Verifying MySQL
Installation
16
• After MySQL has been successfully installed,
the base tables have been initialized, and the
server has been started, you can verify that all
is working as it should via some simple tests.
• Use the mysqladmin Utility to Obtain Server
Status:
• Use mysqladmin binary to check server
version. This binary would be available in
/usr/bin on linux and in C:mysqlbin on
windows.
17. 17
It will produce the following result on Linux
Verifying MySQL
Installation
19. Post Installation Steps:
19
MySQL ships with a blank password for
the root MySQL user. As soon as you have
successfully installed the database and
client, you need to set a root password as
follows:
20. Connect to MySQL
20
Now to make a connection to your MySQL
server, you would have to use the
following command:
22. Running MySQL at boot
time:
22
If you want to run MySQL server at
boot time, then make sure you have
following entry in /etc/rc.local file.
23. Execute simple SQL
commands using MySQL
Client:
23
You can connect to your MySQL server
by using MySQL client
using mysql command.
At this moment, you do not need to
give any password as by default it will
be set to blank.
25. Running and Shutting
down MySQL Server:
25
First check if your MySQL server is
running or not. You can use the
following command to check this:
If your MySql is running, then you will
see mysqld process listed out in your result.
26. Running and Shutting
down MySQL Server:
26
If server is not running, then you can
start it by using the following
command:
27. Running and Shutting
down MySQL Server:
27
if you want to shut down an already
running MySQL server, then you can
do it by using the following command: