In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article is about how to install mysql on Linux. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
1. View linux operating system version and system kernel version
[root@nfs_client ~] # cat / etc/redhat-release View operating system version
CentOS Linux release 7.5.1804 (Core)
[root@nfs_client ~] # uname-r View system kernel version
3.10.0-862.el7.x86_64
Download the corresponding version of the MySQL installation file
1. Download address: https://dev.mysql.com/downloads/mysql/
Download:
Uninstall the old version of MySql (if not, skip this step)
1. View the old version of MySql
Rpm-qa | grep mysql
A list of components of the older version of MySql will be listed, such as:
My computer only shows one here, and there may be more than one.
2. Delete the old components one by one
Use the command rpm-e-- nodeps {- file-name} to remove. There may be dependencies when removing, so pay attention to a certain order.
The first time the deletion did not succeed because there was an extra space at the end.
4. Installation process:
Extract the tar file
Command:
Tar-xvf mysql-5.7.19-1.el7.x86_64.rpm-bundle.tar
Execution result:
[root@localhost software] # tar-xvf mysql-5.7.19-1.el7.x86_64.rpm-bundle.tar mysql-community-embedded-devel-5.7.19-1.el7.x86_64.rpmmysql-community-client-5.7.19-1.el7.x86_64.rpmmysql-community-server-5.7.19-1.el7.x86_64.rpmmysql-community-test-5.7.19-1.el7.x86_64.rpmmysql-community-embedded-compat -5.7.19-1.el7.x86_64.rpmmysql-community-minimal-debuginfo-5.7.19-1.el7.x86_64.rpmmysql-community-server-minimal-5.7.19-1.el7.x86_64.rpmmysql-community-libs-compat-5.7.19-1.el7.x86_64.rpmmysql-community-common-5.7.19-1.el7.x86_64.rpmmysql-community-embedded-5.7.19-1.el7.x86_64 .rpmMySQL-community-devel-5.7.19-1.el7.x86_64.rpmmysql-community-libs-5.7.19-1.el7.x86_64.rpm installs dependent components
The following problems occurred when I was installing msql-community-server-xxx
[root@localhost software] # rpm-ivh mysql-community-server-5.7.19-1.el7.x86_64.rpm warning: mysql-community-server-5.7.19-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature Key ID 5072e1f5: NOKEYerror: Failed dependencies: / usr/bin/perl is needed by mysql-community-server-5.7.19-1.el7.x86_64 libaio.so.1 () (64bit) is needed by mysql-community-server-5.7.19-1.el7.x86_64 libaio.so.1 (LIBAIO_0.1) (64bit) is needed by mysql-community-server-5.7.19-1.el7.x86_64 libaio .so.1 (LIBAIO_0.4) (64bit) is needed by mysql-community-server-5.7.19-1.el7.x86_64 net-tools is needed by mysql-community-server-5.7.19-1.el7.x86_64 perl (Getopt::Long) is needed by mysql-community-server-5.7.19-1.el7.x86_64 perl (strict) is needed by mysql-community-server-5.7.19-1.el7.x86_64 [root@localhost software] #
From the above error, we can see that we need to install the corresponding dependencies.
Libaio
Net-tools
Perl
Installation dependency
Yum-y install libaioyum-y install net-toolsyum-y install perl install mysql components
After the decompression above, we got a lot of rpm files. But we don't need so much, we just need to install four components.
Mysql-community-common-5.7.19-1.el7.x86_64.rpmmysql-community-libs-5.7.19-1.el7.x86_64.rpmmysql-community-client-5.7.19-1.el7.x86_64.rpmmysql-community-server-5.7.19-1.el7.x86_64.rpm
Because of the dependency, we need to execute it sequentially.
You can install the appropriate components with the rpm-ivh filename.
When performing server, you need to rely on installing some tool components, as explained above
Installation commands:
Rpm-ivh mysql-community-common-5.7.19-1.el7.x86_64.rpmrpm-ivh mysql-community-libs-5.7.19-1.el7.x86_64.rpmrpm-ivh mysql-community-client-5.7.19-1.el7.x86_64.rpmrpm-ivh mysql-community-server-5.7.19-1.el7.x86_64.rpm
Execution process:
Root@localhost software] # rpm-ivh mysql-community-common-5.7.19-1.el7.x86_64.rpm warning: mysql-community-common-5.7.19-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEYPreparing... # # [100%] Updating / installing... 1:mysql-community-common-5.7.19-1.e## [root@localhost software] # rpm-ivh mysql-community-libs-5.7.19-1.el7.x86_64.rpm warning: mysql-community-libs-5.7.19-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEYPreparing... # # [100%] Updating / installing... 1:mysql-community-libs-5.7.19-1.el7## [root@localhost software] # rpm-ivh mysql-community-client-5.7.19-1.el7.x86_64.rpm warning: mysql-community-client-5.7.19-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEYPreparing... # # [100%] Updating / installing... 1:mysql-community-client-5.7.19-1.e## [root@localhost software] # rpm-ivh mysql-community-server-5.7.19-1.el7.x86_64.rpmwarning: mysql-community-server-5.7.19-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEYPreparing... # # [100%] Updating / installing... 1:mysql-community-server-5.7.19-1.e## [100%]
Start the database
×
Advertising
MySQL5.7 installation-RPM installation under Linux
Sweet potato IT attention
0.12017.09.09 16 19* words 623 read 1557 comments 1 like 1
The latest version of MySQL5.7 is 5.7.19.
download
Address: https://dev.mysql.com/downloads/mysql/
Name: mysql-5.7.19-1.el7.x86_64.rpm-bundle.tar
Installation
I have put the installation package under the / usr/local/software path
[root@localhost software] # lsmysql-5.7.19-1.el7.x86_64.rpm-bundle.tar to see if mysqlrpm-qa is installed | grep mysql decompresses the tar file
Command
Tar-xvf mysql-5.7.19-1.el7.x86_64.rpm-bundle.tar
Execution result
[root@localhost software] # tar-xvf mysql-5.7.19-1.el7.x86_64.rpm-bundle.tar mysql-community-embedded-devel-5.7.19-1.el7.x86_64.rpmmysql-community-client-5.7.19-1.el7.x86_64.rpmmysql-community-server-5.7.19-1.el7.x86_64.rpmmysql-community-test-5.7.19-1.el7.x86_64.rpmmysql-community-embedded-compat -5.7.19-1.el7.x86_64.rpmmysql-community-minimal-debuginfo-5.7.19-1.el7.x86_64.rpmmysql-community-server-minimal-5.7.19-1.el7.x86_64.rpmmysql-community-libs-compat-5.7.19-1.el7.x86_64.rpmmysql-community-common-5.7.19-1.el7.x86_64.rpmmysql-community-embedded-5.7.19-1.el7.x86_64 .rpmMySQL-community-devel-5.7.19-1.el7.x86_64.rpmmysql-community-libs-5.7.19-1.el7.x86_64.rpm uninstalls conflicting RPM components
When we install mysql-related components, if we do not remove the conflicting components, we will not be able to install them successfully.
We can skip this step and proceed directly to the next step, which will be prompted during the installation process. Here is a hint I came across:
# dependency error when installing mysql components error: Failed dependencies: mysql-community-common (x86-64) > = 5.7.9 is needed by mysql-community-libs-5.7.19-1.el7.x86_64 mariadb-libs is obsoleted by mysql-community-libs-5.7.19-1.el7.x86_64 # dependency error error: Failed dependencies: libmysqlclient when uninstalling mariadb-libs. So.18 () (64bit) is needed by (installed) postfix-2:2.10.1-6.el7.x86_64 libmysqlclient.so.18 (libmysqlclient_18) (64bit) is needed by (installed) postfix-2:2.10.1-6.el7.x86_64
As you can see, we need to uninstall the components related to postfix and mariadb-libs. Uninstall we can use rpm-ev xxx.
View postfix and mariadb-libs
Rpm-qa | grep postfixrpm-qa | grep mariadb
Execution process
[root@localhost software] # rpm-qa | grep postfixpostfix-2.10.1-6.el7.x86_64 [root@localhost software] # rpm-qa | grep mariadbmariadb-libs-5.5.52-1.el7.x86_64
Uninstall postfix and mariadb-libs
Rpm-ev postfix-2.10.1-6.el7.x86_64rpm-ev mariadb-libs-5.5.52-1.el7.x86_64
Execution process
[root@localhost software] # rpm-ev postfix-2.10.1-6.el7.x86_64Preparing packages...postfix-2:2.10.1-6.el7.x86_64 [root@localhost software] # rpm-ev mariadb-libs-5.5.52-1.el7.x86_64Preparing packages...mariadb-libs-1:5.5.52-1.el7.x86_64 installation dependent components
The following problems occurred when I was installing msql-community-server-xxx
[root@localhost software] # rpm-ivh mysql-community-server-5.7.19-1.el7.x86_64.rpm warning: mysql-community-server-5.7.19-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature Key ID 5072e1f5: NOKEYerror: Failed dependencies: / usr/bin/perl is needed by mysql-community-server-5.7.19-1.el7.x86_64 libaio.so.1 () (64bit) is needed by mysql-community-server-5.7.19-1.el7.x86_64 libaio.so.1 (LIBAIO_0.1) (64bit) is needed by mysql-community-server-5.7.19-1.el7.x86_64 libaio .so.1 (LIBAIO_0.4) (64bit) is needed by mysql-community-server-5.7.19-1.el7.x86_64 net-tools is needed by mysql-community-server-5.7.19-1.el7.x86_64 perl (Getopt::Long) is needed by mysql-community-server-5.7.19-1.el7.x86_64 perl (strict) is needed by mysql-community-server-5.7.19-1.el7.x86_64 [root@localhost software] #
From the above error, we can see that we need to install the corresponding dependencies.
Libaio
Net-tools
Perl
Installation dependency
Yum-y install libaioyum-y install net-toolsyum-y install perl install mysql components
After the decompression above, we got a lot of rpm files. But we don't need that much, we just need to install four components:
Mysql-community-common-5.7.19-1.el7.x86_64.rpm
Mysql-community-libs-5.7.19-1.el7.x86_64.rpm
Mysql-community-client-5.7.19-1.el7.x86_64.rpm
Mysql-community-server-5.7.19-1.el7.x86_64.rpm
Because of the dependency, we need to execute it sequentially.
You can install the appropriate components with the rpm-ivh filename.
When performing server, you need to rely on installing some tool components, as explained above
Installation command
Rpm-ivh mysql-community-common-5.7.19-1.el7.x86_64.rpmrpm-ivh mysql-community-libs-5.7.19-1.el7.x86_64.rpmrpm-ivh mysql-community-client-5.7.19-1.el7.x86_64.rpmrpm-ivh mysql-community-server-5.7.19-1.el7.x86_64.rpm
Execution process
[root@localhost software] # rpm-ivh mysql-community-common-5.7.19-1.el7.x86_64.rpm warning: mysql-community-common-5.7.19-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEYPreparing... # # [100%] Updating / installing... 1:mysql-community-common-5.7.19-1.e## [root@localhost software] # rpm-ivh mysql-community-libs-5.7.19-1.el7.x86_64.rpm warning: mysql-community-libs-5.7.19-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEYPreparing... # # [100%] Updating / installing... 1:mysql-community-libs-5.7.19-1.el7## [root@localhost software] # rpm-ivh mysql-community-client-5.7.19-1.el7.x86_64.rpm warning: mysql-community-client-5.7.19-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEYPreparing... # # [100%] Updating / installing... 1:mysql-community-client-5.7.19-1.e## [root@localhost software] # rpm-ivh mysql-community-server-5.7.19-1.el7.x86_64.rpmwarning: mysql-community-server-5.7.19-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEYPreparing... # # [100%] Updating / installing... 1:mysql-community-server-5.7.19-1.e## [100%] start the database # check whether mysql starts service mysqld status# start mysqlservice mysqld start# stop mysqlservice mysqld stop# restart mysqlservice mysqld restart change password
We did not set a password after the mysql installation, but mysql set a temporary password for us. We can check the mysql log to know the temporary password.
View temporary password
Grep password / var/log/mysqld.log
Execution process
[root@localhost ~] # grep password / var/log/mysqld.log 2017-09-01T16:43:10.889769Z 1 [Note] A temporary password is generated for root@localhost: hcLMTxbOh3?w
So we know that the temporary password is: hcLMTxbOh3?w.
Then we use this temporary password to log in to the database.
The password of the database needs to meet the following conditions: uppercase and lowercase letters, numbers and special symbols
Execute a command
# Log in to mysql, then enter the password mysql-p # to set the new password set password = password ("Mysql_123456"); # log out of the current login quit
Execution process:
[root@localhost] # mysql-pEnter password: Welcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 6Server version: 5.7.19 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 itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.mysql > set password = password ("Mysql_123456"); Query OK, 0 rows affected, 1 warning (0.00 sec) mysql > quit
Log in again so that we can log in with the new password. We can operate the database happily.
Thank you for reading! This is the end of the article on "how to install mysql under the Linux system". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.