Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Centos7 yum install mysql5.7

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Centos 7 removes MySQL database software from the default list of programs and replaces it with mariadb.

That is to say, it is no longer possible to install directly using yum as in the previous 6, but using the software source provided by the official website. This installation version is 5.7

1. Install the yum source provided on the official website

# wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm# rpm-ivh mysql57-community-release-el7-11.noarch.rpm

two。 Install MySQL

# yum-y install mysql-server

3. Modify Mysql configuration file

# vim / etc/ my.cnf [mysqld] character-set-server=utf8

4. Start MySQL

Q start MySQL

[root@master ~] # systemctl start mysqld

Q set MySQL to boot

[root@master ~] # systemctl enable mysqld

5. Change the password & enter the MySQL database

The Mysql5.7 version and later will no longer use an empty password, but will generate a temporary password during installation and save it in a log file

[root@host-192-168-8-37] # grep 'password' / var/log/mysqld.log 2017-10-16T02:12:56.016829Z 1 [Note] A temporary password is generated for root@localhost: # zua) gQ?e5Gi

Here, change the user's password to: Mysql_password123

[root@host-192-8-37 yum.repos.d] # mysql-u root-pEnter password:Welcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 5Server version: 5.7.19Copyright (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 > alter user 'root'@'localhost' identified by' Mysql_password123';Query OK, 0 rows affected (0.00 sec) mysql >

6. Configure MySQL

Q create database (database name: cache_cloud; code: UTF-8)

Mysql > create database cache_cloud default charset utf8;Query OK, 1 row affected (0.00 sec) mysql > show databases +-+ | Database | +-+ | information_schema | | cache_cloud | | mysql | | performance_schema | | sys | +-+ 5 rows in set (0.01sec) mysql >

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report