Tutorial on installing MySQL 5.6 using RPM in CentOS

Tutorial on installing MySQL 5.6 using RPM in CentOS

All previous projects were deployed in the Windows system environment. This time we tried to deploy them in the Linux system environment. So this time we installed JDK, Maven, and Jboss on 7 hosts, installed Mysql on one of them, and configured the LAN. Finally, we completed the task. The installation steps will be shared with you below!

System version: centos6.3-i386 32-bit operating system
Hardware configuration: Core Intel(R) Pentium(R) 4 CPU 3.00GHz Memory 998.5M
Installation environment: Use shell command

This installation is in the desktop environment. Use shell commands to install. The downloaded installation package is:
MySQL-5.6.25-1.linux_glibc2.5.i386.rpm-bundle.tar;
a. Check whether MySQL and related RPM packages are installed. If so, remove them (rpm –e name)

[root@localhost ~]# rpm -qa | grep -i mysql
mysql-libs-5.1.66-2.el6_3.x86_64
[root@localhost ~]# yum -y remove mysql-libs*

b. Select the RPM package corresponding to Linux, as follows:

[root@localhost rpm]# ll
total 74364
-rw-r--r--. 1 root root 18442536 Dec 11 20:19 MySQL-client-5.6.15-1.el6.x86_64.rpm
-rw-r--r--. 1 root root 3340660 Dec 11 20:06 MySQL-devel-5.6.15-1.el6.x86_64.rpm
-rw-r--r--. 1 root root 54360600 Dec 11 20:03 MySQL-server-5.6.15-1.el6.x86_64.rpm

c. Install MySQL

[root@localhost rpm]# rpm -ivh MySQL-server-5.6.15-1.el6.x86_64.rpm
[root@localhost rpm]# rpm -ivh MySQL-devel-5.6.15-1.el6.x86_64.rpm
[root@localhost rpm]# rpm -ivh MySQL-client-5.6.15-1.el6.x86_64.rpm
#Modify the configuration file location [root@localhost rpm]# cp /usr/share/mysql/my-default.cnf /etc/my.cnf

d. Initialize MySQL and set password

[root@localhost rpm]# /usr/bin/mysql_install_db
[root@localhost rpm]# service mysql start
[root@localhost rpm]# cat /root/.mysql_secret # View the root account password# The random password set for the root user at Wed Dec 11 23:32:50 2013 (local time): qKTaFZnl
[root@localhost ~]# mysql -uroot –pqKTaFZnl
mysql> SET PASSWORD = PASSWORD('123456'); #Set the password to 123456
mysql> exit
[root@localhost ~]# mysql -uroot -p123456

e. Remote login user settings

mysql> use mysql;
mysql> select host,user,password from user;
+----------------------+------+------------------------------------------+
| host | user | password |
+----------------------+------+------------------------------------------+
| localhost | root | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |
| localhost.localdomain | root | *1237E2CE819C427B0D8174456DD83C47480D37E8 |
| 127.0.0.1 | root | *1237E2CE819C427B0D8174456DD83C47480D37E8 |
| ::1 | root | *1237E2CE819C427B0D8174456DD83C47480D37E8 |
+----------------------+------+------------------------------------------+
mysql> update user set password=password('123456') where user='root';
mysql> update user set host='%' where user='root' and host='localhost';
mysql> flush privileges;
mysql> exit

f. Set the system to start automatically

[root@localhost ~]# chkconfig mysql on
[root@localhost ~]# chkconfig --list | grep mysql
mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off

g. MySQL default installation location

/var/lib/mysql/ #Database directory /usr/share/mysql #Configuration file directory /usr/bin #Related command directory /etc/init.d/mysql #Startup script

h. Modify the character set and data storage path

Configure the /etc/my.cnf file, modify the data storage path, mysql.sock path and the default encoding utf-8.

[client] 
password = 123456 
port = 3306 
default-character-set=utf8 
[mysqld] 
port = 3306 
character_set_server=utf8 
character_set_client=utf8 
collation-server=utf8_general_ci 
#(Note that after installing MySQL in Linux, the default is: table names are case-sensitive, column names are not case-sensitive; 0: case-sensitive, 1: case-insensitive) 
lower_case_table_names=1 
#(Set the maximum number of connections, the default is 151, the maximum number of connections allowed by the MySQL server is 16384; ) 
max_connections=1000 
[mysql] 
default-character-set = utf8 

Viewable character set

show variables like '%collation%'; 
show variables like '%char%';

I. If you want to log in to MySQL remotely, you need to: authorize and turn off the firewall.

1. Authorization; enter mysql on the server and enter the following command

Copy the code as follows:
[GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'here is your password' WITH GRANT OPTION;]

OR
Copy the code as follows:
[GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '' WITH GRANT OPTION;]

The difference lies in whether a password is required for access.
This sentence is used to set all user names to be able to remotely access all tables in MySQL. If you don't want to release all, you can set it according to this rule. Grant permission 1, permission 2, ... permission n on database name. table name to user name @ user address identified by 'password'.

2. Turn off the firewall

service iptables stop Shutdown command chkconfig iptables off Permanently shut down the firewall

Run the two commands at the same time. After the execution is complete, check the firewall shutdown status.

service iptables status

At this point, MySQL has been installed and configured successfully.

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Install mysql5.7.17 using RPM under Linux
  • Complete steps to install the latest mysql5.7.17 using rpm in Linux system
  • Install mysql5.7.13 using RPM in CentOS 7
  • Record the solution of unable to install mysql-Invalid GPG Key from file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
  • Detailed explanation of installing MySQL version 5.6 using rpm
  • CentOS7 detailed installation of MySQL using rpm
  • Detailed tutorial on installing mysql5.6.33 using RPM in CentOS6.5
  • Install MySQL 5.6 source code using RPM
  • Tutorial on installing mysql in rpm mode under Linux
  • Completely delete Mysql in Centos (rpm, yum installation)

<<:  Detailed explanation of custom configuration of docker official mysql image

>>:  JavaScript to filter arrays

Recommend

CSS inheritance method

Given a div with the following background image: ...

MySQL optimization query_cache_limit parameter description

query_cache_limit query_cache_limit specifies the...

Solution for Vue routing this.route.push jump page not refreshing

Vue routing this.route.push jump page does not re...

Detailed example of using the distinct method in MySQL

A distinct Meaning: distinct is used to query the...

Detailed explanation of SQL injection - security (Part 2)

If there are any errors in this article or you ha...

Native JS to implement click number game

Native JS implements the click number game for yo...

Jenkins packaging microservices to build Docker images and run them

Table of contents Environment Preparation start 1...

Quickly solve the problem that CentOS cannot access the Internet in VMware

Yesterday I installed CentOS7 under VMware. I wan...

How to set static IP in centOS7 NET mode

Preface NAT forwarding: Simply put, NAT is the us...

Summary of Common Mistakes in Web Design

In the process of designing a web page, designers...

How to use Linux tr command

01. Command Overview The tr command can replace, ...

Getting Started Tutorial on Using TS (TypeScript) in Vue Project

Table of contents 1. Introducing Typescript 2. Co...

Idea deployment tomcat service implementation process diagram

First configure the project artifacts Configuring...

VMware12 installs Ubuntu19.04 desktop version (installation tutorial)

1. Experimental description In the virtual machin...