linux17 mysql_installation

28
MySQL on Linux jainul.musani@gma il.com 1

Upload: jainul-musani

Post on 17-May-2015

702 views

Category:

Education


0 download

DESCRIPTION

MySQL on Linux

TRANSCRIPT

Page 1: Linux17 MySQL_installation

MySQL on Linux

[email protected]

1

Page 2: Linux17 MySQL_installation

MySQL Database:

• MySQL is developed, marketed, and supported by MySQL AB.

• Swedish company

MySQL on Linux

2

Page 3: Linux17 MySQL_installation

MySQL Database:

• Fast• Easy-to-use RDBMS• For small and big businesses

MySQL on Linux

3

Page 4: Linux17 MySQL_installation

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

Page 5: Linux17 MySQL_installation

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

Page 6: Linux17 MySQL_installation

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

Page 7: Linux17 MySQL_installation

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

Page 8: Linux17 MySQL_installation

Downloading MySQL• All downloads for MySQL are located

at MySQL Downloads1)http://www.mysql.com/downloads2)http://dev.mysql.com/downloads/

mysql/5.1.html

MySQL on Linux

8

Page 9: Linux17 MySQL_installation

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.rpm2. MySQL-server-community-5.1.25-0.rhel5.i386.rpm3. MySQL-devel-community-5.1.25-0.rhel5.i386.rpm

MySQL on Linux

9

Page 10: Linux17 MySQL_installation

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

Page 11: Linux17 MySQL_installation

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

Page 12: Linux17 MySQL_installation

Downloading MySQLThe 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

Page 13: Linux17 MySQL_installation

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

Page 14: Linux17 MySQL_installation

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

Page 15: Linux17 MySQL_installation

15

Installing MySQL

• This is optinal but recommanded step to install the remaining RPMs_

Page 16: Linux17 MySQL_installation

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:\mysql\bin on windows.

Page 17: Linux17 MySQL_installation

17

It will produce the following result on Linux

Verifying MySQL Installation

Page 18: Linux17 MySQL_installation

Follows the steps below to stop and start MySQL

18

Page 19: Linux17 MySQL_installation

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:

Page 20: Linux17 MySQL_installation

Connect to MySQL

20

Now to make a connection to your MySQL server, you would have to use the following command:

Page 21: Linux17 MySQL_installation

Connect to MySQL

21

Page 22: Linux17 MySQL_installation

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.

Page 23: Linux17 MySQL_installation

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.

Page 24: Linux17 MySQL_installation

Execute simple SQL commands using MySQL Client:

24

Page 25: Linux17 MySQL_installation

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.

Page 26: Linux17 MySQL_installation

Running and Shutting down MySQL Server:

26

If server is not running, then you can start it by using the following command:

Page 27: Linux17 MySQL_installation

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:

Page 28: Linux17 MySQL_installation

Bibliography

1) https://dev.mysql.com/doc/refman/5.1/en/linux-installation-rpm.html

2) http://www.tutorialspoint.com/mysql/mysql-administration.htm

3) http://www.thegeekstuff.com/2008/07/howto-install-mysql-on-linux/

4) http://www.cyberciti.biz/faq/how-to-install-mysql-under-rhel/

28