Installation of mysql-community-server. 5.7.18-1.el6 under centos 6.5

Installation of mysql-community-server. 5.7.18-1.el6 under centos 6.5

Use the following command to check whether MySQL Server is installed

[root@localhost etc]# rpm -qa | grep mysql // This command will check whether the mysql database has been installed on the operating system

If yes, we can uninstall it through rpm -e command or rpm -e --nodeps command.

[root@localhost ~]# rpm -e mysql // Normal deletion mode [root@localhost ~]# rpm -e --nodeps mysql // Forced deletion mode. If you are prompted to delete other dependent files when using the above command, you can use this command to forcefully delete them.

After deleting, we can use the rpm -qa | grep mysql command to check whether mysql has been uninstalled successfully! !

Download the installation package from the official website yum repository

[root@localhost ~]# wget http://dev.mysql.com/get/mysql57-community-release-el6-10.noarch.rpm
 --2017-04-24 18:53:49-- http://dev.mysql.com/get/mysql57-community-release-el6-10.noarch.rpm
Resolving dev.mysql.com... 137.254.60.11
Connecting to dev.mysql.com|137.254.60.11|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://dev.mysql.com/get/mysql57-community-release-el6-10.noarch.rpm [following]
--2017-04-24 18:53:49-- https://dev.mysql.com/get/mysql57-community-release-el6-10.noarch.rpm
Connecting to dev.mysql.com|137.254.60.11|:443... connected.
ERROR: certificate common name "www.mysql.com" doesn't match requested host name "dev.mysql.com".
To connect to dev.mysql.com insecurely, use '--no-check-certificate'

Install the downloaded rpm package locally

[root@localhost ~]# yum localinstall mysql57-community-release-el6-10.noarch.rpm
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Local Package Process
Examining mysql57-community-release-el6-10.noarch.rpm: mysql57-community-release-el6-10.noarch
Marking mysql57-community-release-el6-10.noarch.rpm to be installed
Loading mirror speeds from cached hostfile
 * base: mirrors.cn99.com
 * extras: mirrors.cn99.com
 * updates: mirrors.cn99.com
Resolving Dependencies
--> Running transaction check
---> Package mysql57-community-release.noarch 0:el6-10 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===============================================================================================================================================================================================
 Package Arch Version Repository Size
===============================================================================================================================================================================================
Installing:
 mysql57-community-release noarch el6-10 /mysql57-community-release-el6-10.noarch 30 k
Transaction Summary
===============================================================================================================================================================================================
Install 1 Package(s)
Total size: 30k
Installed size: 30 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
 Installing:mysql57-community-release-el6-10.noarch 1/1
 Verifying : mysql57-community-release-el6-10.noarch 1/1
Installed:
 mysql57-community-release.noarch 0:el6-10                          
Complete!

View available installation packages

[root@localhost ~]# yum repolist enabled|grep mysql
mysql-connectors-community MySQL Connectors Community 33
mysql-tools-community MySQL Tools Community 47
mysql57-community MySQL 5.7 Community Server 183

Install all gcc packages before installation to avoid the error [Errno -1] Package does not match intended download

[root@localhost yum.repos.d]# yum install gcc*

Install mysql

[root@localhost yum.repos.d]# yum install -y mysql-community-server 
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirrors.cn99.com
 * extras: mirrors.cn99.com
 * updates: mirrors.cn99.com
Setting up Installation Process
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.7.18-1.el6 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 5.7.18-1.el6 for package: mysql-community-server-5.7.18-1.el6.x86_64
--> Processing Dependency: mysql-community-client(x86-64) >= 5.7.9 for package: mysql-community-server-5.7.18-1.el6.x86_64
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.7.18-1.el6 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) >= 5.7.9 for package: mysql-community-client-5.7.18-1.el6.x86_64
---> Package mysql-community-common.x86_64 0:5.7.18-1.el6 will be installed
--> Running transaction check
---> Package mysql-community-libs.x86_64 0:5.7.18-1.el6 will be obsoleting
---> Package mysql-libs.x86_64 0:5.1.71-1.el6 will be obsoleted
--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: 2:postfix-2.6.6-2.2.el6_1.x86_64
--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: 2:postfix-2.6.6-2.2.el6_1.x86_64
--> Running transaction check
---> Package mysql-community-libs-compat.x86_64 0:5.7.18-1.el6 will be obsoleting
---> Package postfix.x86_64 2:2.6.6-2.2.el6_1 will be updated
---> Package postfix.x86_64 2:2.6.6-8.el6 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================
 Package Arch Version Repository Size
=============================================================================================================================
Installing:
 mysql-community-libs x86_64 5.7.18-1.el6 mysql57-community 2.1 M
   replacing mysql-libs.x86_64 5.1.71-1.el6
 mysql-community-libs-compat x86_64 5.7.18-1.el6 mysql57-community 1.6 M
   replacing mysql-libs.x86_64 5.1.71-1.el6
 mysql-community-server x86_64 5.7.18-1.el6 mysql57-community 152 M
Installing for dependencies:
 mysql-community-client x86_64 5.7.18-1.el6 mysql57-community 23 M
 mysql-community-common x86_64 5.7.18-1.el6 mysql57-community 328 k
Updating for dependencies:
 postfix x86_64 2:2.6.6-8.el6 base 2.0 M
Transaction Summary
=============================================================================================================================
Install 5 Package(s)
Upgrade 1 Package(s)
Total size: 180 M
Total download size: 152 M
Downloading Packages:
mysql-community-server-5.7.18-1.el6.x86_64.rpm | 152 MB 01:41  
warning: rpmts_HdrFromFdno: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Importing GPG key 0x5072E1F5:
 Userid : MySQL Release Engineering <[email protected]>
 Package: mysql57-community-release-el6-10.noarch (@/mysql57-community-release-el6-10.noarch)
 From : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
 Installing: mysql-community-common-5.7.18-1.el6.x86_64 1/8
 Installing: mysql-community-libs-5.7.18-1.el6.x86_64 2/8
 Installing: mysql-community-libs-compat-5.7.18-1.el6.x86_64 3/8
 Installing: mysql-community-client-5.7.18-1.el6.x86_64 4/8
 Installing: mysql-community-server-5.7.18-1.el6.x86_64 5/8
 Updating: 2:postfix-2.6.6-8.el6.x86_64 6/8
 Cleanup: 2:postfix-2.6.6-2.2.el6_1.x86_64 7/8
 Erasing: mysql-libs-5.1.71-1.el6.x86_64 8/8
 Verifying : 2:postfix-2.6.6-8.el6.x86_64 1/8
 Verifying : mysql-community-libs-compat-5.7.18-1.el6.x86_64 2/8
 Verifying : mysql-community-server-5.7.18-1.el6.x86_64 3/8
 Verifying : mysql-community-libs-5.7.18-1.el6.x86_64 4/8
 Verifying : mysql-community-common-5.7.18-1.el6.x86_64 5/8
 Verifying : mysql-community-client-5.7.18-1.el6.x86_64 6/8
 Verifying : 2:postfix-2.6.6-2.2.el6_1.x86_64 7/8
 Verifying : mysql-libs-5.1.71-1.el6.x86_64 8/8
Installed:
 mysql-community-libs.x86_64 0:5.7.18-1.el6 mysql-community-libs-compat.x86_64 0:5.7.18-1.el6       
 mysql-community-server.x86_64 0:5.7.18-1.el6       
Dependency Installed:
 mysql-community-client.x86_64 0:5.7.18-1.el6 mysql-community-common.x86_64 0:5.7.18-1.el6        
Dependency Updated:
 postfix.x86_64 2:2.6.6-8.el6                                               
Replaced:
 mysql-libs.x86_64 0:5.1.71-1.el6                        
Complete!

Start mysql

[root@localhost yum.repos.d]# service mysqld start 
 Initializing MySQL database: [ OK ]
Installing validate password plugin: [ OK ]
Starting mysqld:

Enter mysql safe mode

[root@localhost yum.repos.d]# killall -TERM mysqld
[root@localhost yum.repos.d]# mysqld_safe --skip-grant-tables &
[1] 40422
[root@localhost yum.repos.d]# 2017-04-25T07:45:39.222061Z mysqld_safe Logging to '/var/log/mysqld.log'.
2017-04-25T07:45:39.246117Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.18 MySQL Community Server (GPL)
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select * from users;
ERROR 1146 (42S02): Table 'mysql.users' doesn't exist
mysql> select * from user;
mysql> update user set authentication_string=PASSWORD('mysql') where user='root';
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 1
mysql> quit
Bye
[2]+ Exit 1 mysqld_safe --skip-grant-tables
 
 [root@localhost yum.repos.d]# service mysqld start
Starting mysqld: [ OK ]
[root@localhost yum.repos.d]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.18 MySQL Community Server (GPL)
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql -h host address -u username -p user password

1. Example 1: Connect to MYSQL on this machine

Find the installation directory of MySQL. Generally, you can directly type the command mysql -uroot -p. Press Enter and you will be prompted to enter the password. If MYSQL has just been installed, the super user root has no password, so just press Enter to enter MYSQL.

The MYSQL prompt is: mysql>

2. Connect to MYSQL on the remote host

Assume that the IP address of the remote host is 10.0.0.1, the username is root, and the password is 123. Then type the following command:

mysql -h10.0.0.1 -uroot -p123

(Note: u and root do not need spaces, and the same applies to the others)

Configuring the Firewall

The firewall's port 3306 is not open by default. If you want to access remotely, you need to open this port.

Open /etc/sysconfig/iptables

Under "-A INPUT –m state --state NEW –m tcp –p tcp –dport 22 –j ACCEPT", add:

-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

Then save and close the file, and run the following command in the terminal to refresh the firewall configuration:

service iptables restart OK, everything is configured, you can access your MySQL~

Note: The statement to open port 3306 must be placed before icmp-host-prohibited

mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.18 MySQL Community Server (GPL)

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

The above is the installation of mysql-community-server. 5.7.18-1.el6 under centos 6.5 introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • mysql installer community 8.0.16.0 installation and configuration graphic tutorial
  • MySQL Installer Community 5.7.16 installation detailed tutorial
  • mysql installer web community 5.7.21.0.msi installation graphic tutorial
  • mysql installer community 8.0.12.0 installation graphic tutorial
  • Solution to MySQL Installer is running in Community mode
  • MySQL Community Server 8.0.11 installation and configuration method graphic tutorial
  • Unity connects to MySQL and reads table data implementation code

<<:  Native js to achieve star twinkling effect

>>:  How to implement Linux automatic shutdown when the battery is low

Recommend

Shorten the page rendering time to make the page run faster

How to shorten the page rendering time on the bro...

Implementation of building custom images with Dockerfile

Table of contents Preface Introduction to Dockerf...

JavaScript implements countdown on front-end web page

Use native JavaScript to simply implement the cou...

Detailed explanation of tinyMCE usage and experience

Detailed explanation of tinyMCE usage initializat...

Analysis of several situations where MySQL index fails

1. Best left prefix principle - If multiple colum...

Sample code for implementing 3D book effect with CSS

Without further ado, let's take a look at the...

How to install redis in docker and set password and connect

Redis is a distributed cache service. Caching is ...

Why does using limit in MySQL affect performance?

First, let me explain the version of MySQL: mysql...

The difference between html Frame, Iframe and Frameset

10.4.1 The difference between Frameset and Frame ...

js realizes 3D sound effects through audioContext

This article shares the specific code of js to ac...

MySQL 8.0.15 winx64 installation and configuration method graphic tutorial

This article shares the installation and configur...

Complete steps for vue dynamic binding icons

0 Differences between icons and images Icons are ...