Installing MySQL Server using RPM.
MySQL can be installed on the Linux distributions by using below methods.
1. RPM
2. MySQL Binaries Installation
3. YUM Repository.
1. Download the latest stable release of MySQL.
MySQL can be downloaded from http://dev.mysql.com/downloads/mysql/. Please select the appropriate RPM used for installation on Linux server. Please select the RPM's according to the installation i.e., 32 bit or 64 bit.
Please download the below RPM from the above site after selecting the Red Hat Linux.
1. MySQL-shared-compat-5.6.23-1.el7.x86_64.rpm
2. MySQL-test-5.6.23-1.el7.x86_64.rpm
3. MySQL-devel-5.6.23-1.el7.x86_64.rpm
4. MySQL-client-5.6.23-1.el7.x86_64.rpm
5. MySQL-server-5.6.23-1.el7.x86_64.rpm
6. MySQL-shared-5.6.23-1.el7.x86_64.rpm
7. MySQL-embedded-5.6.23-1.el7.x86_64.rpm
2. Remove the existing default MySQL that came with the Linux distro.
# rpm -qa | grep -i mysql
mysql-5.0.22-2.1.0.1
mysqlclient10-3.23.58-4.RHEL4.1
3. Install the downloaded MySQL package
Install the MySQL Server and Client packages as shown below.
# rpm -ivh MySQL-server-5.6.23-1.el7.x86_64.rpm
# rpm -ivh MySQL-client-5.6.23-1.el7.x86_64.rpm
Install all the RPM's of MySQL Server one by one. After the installation the mysqld process will be started. Then we can connect to the mysql server.
4. Perform post-install security activities on MySQL.
We should set a password for the root user as shown below:
# /usr/bin/mysqladmin -u root password 'Coffee$1234#'
The best option is to run the mysql_secure_installation script that will take care of all the typical security related items on the MySQL as shown below. On a high level this does the following items:
1. Change the root password
2. Remove the anonymous user
3. Disallow root login from remote machines
4. Remove the default sample test database
Please run the below command on the server
# /usr/bin/mysql_secure_installation
After running the command it ask user to change the root password, removing any anonymous users on the server, and the server do not allow the root logins from remote machines and removing the default sample databases on the server.
5. Verify the MySQL installation:
# mysql -V
The above command show the information of the mysql version installed on the Linux machine.
Connect to the MySQL database using the root user and make sure the connection is successfull.
# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 13
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
Follows the steps below to stop and start MySQL
# service mysql status
MySQL running (12588) [ OK ]
# service mysql stop
Shutting down MySQL. [ OK ]
# service mysql start
Starting MySQL. [ OK ]
No comments:
Post a Comment