当前位置:网站首页>Centos7 install MySQL using Yum - specify the version
Centos7 install MySQL using Yum - specify the version
2022-04-21 23:38:00 【Any3321】
stay CentOS Use in yum Install the specified version of MySQL
1、 Get into MySQL Official website acquisition MySQL Of yum Source , Order as follows :
Click on DownLoad ——> Click on the MySQL Community (GPL) Downloads ——> Click on MySQL Yum Repository ——> According to oneself CentOS Choose the version to download rpm package
2、 Download the rpm Put the bag in CentOS Server ( Such as :/opt/mysql Next ), After the installation rpm package
rpm -Uvh /opt/mysql/mysql80-community-release-el7-5.noarch.rpm
The following path depends on the stored rpm Package specific path modification
3、 Check if... Is installed on the server MySQL
yum list installed | grep mysql
If installed MySQL Words , At this time, you need to uninstall , reinstall , The unloading instructions are as follows :
rpm -e --nodeps mysql
Not recommended yum remove To delete the software , Because all related dependent packages will be deleted .
4、 Use yum see MySQL The warehouse of , see MySQL Version of
yum repolist | grep mysql

At this time, you can see the default choice MySQL The version is 8, If you want to choose another version , such as 5.7, So it's forbidden 8 Version of , Turn on 5.7 Version of . There are two ways to operate :
1). Use yum The command operation
Ban MySQL8 edition
yum-config-manager --disable mysql80-community
Use MySQL5.7 edition
yum-config-manager --enable mysql5.7-community
If you use yum-config-manager Report errors , Then there is no installation yum-utils tool kit , Use yum -y install yum-utils Can be installed .
2). Directly modifying yum Of MySQL The warehouse files , The file path is /etc/yum.repos.d/mysql-community.repo
vim /etc/yum.repos.d/mysql-community.repo
take MySQL 8.0 Community Server Under the enable Set to 0, take MySQL 5.7 Community Server Set to 1, Then save to exit .

Now yum Of MySQL The default installed version of the warehouse is switched to 5.7
5、 install MySQL
yum install -y mysql-community-server
6、MySQL Run after installation is complete MySQL
systemctl start mysqld.service
see MySQL Operating state
systemctl status mysqld.service

The successful running
7、 see MySQL Set up root User's initial password ( stay 5.7 And above , After installation, an initial password will be set by default )
cat /var/log/mysqld.log | grep "password"

The red part is the password
8、 Log in MySQL, Change Password , Set allow remote login
Sign in MySQL
mysql -u root -p
Change Password
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';
new_password Is the new password you want to set , Be careful :MySQL It is required that the password must contain special upper and lower case symbols and numbers .
Set allow remote login (root user )
update mysql.user set host = "%" where user='root';
Refresh the permissions
flush privileges;
9、 modify MySQL The default code of the server is utf8
see MySQL Coding information, etc , Log in MySQL Post input
status;

After query, it is found that the code of the server is not UTF8, sign out MySQL
edit MySQL Configuration file for
vim /etc/my.cnf
Add the content marked with red icon

Save and exit , restart MySQL,MySQL The code of becomes utf8
systemctl restart mysqld.service
版权声明
本文为[Any3321]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204212327407442.html
边栏推荐
- leetcode:271.字符串的编码与解码
- #1143 Longest Common Subsequence
- PHP ueditor uploads files (pictures and videos) to OSS
- 如何让知识图谱辅助多轮对话
- Redis high availability (HA)
- Click, walk and move of characters in 3D sandbox game
- 340-Leetcode 有效的字母异位词
- 【MYSQL优化3】观察mysql进程状态
- Ijcai2022 employment results released! The acceptance rate is 15%. Did you win?
- Use of database connection pool and Druid
猜你喜欢

Man machine verification reCAPTCHA V3 complete instructions

Leetcode:443 Compressed string

JDBC方法参数详解 DriverManager,Statement,Connection,ResultSet,PreparedStatement

6、协议层次化和服务模型(重点)

How to build an observable system that can "evolve continuously"| QCon

SolidWorks hold down Ctrl and drag to copy entities

Click, walk and move of characters in 3D sandbox game

Why don't MySQL use select * as query criteria? (continuously updated)

找出大于X的第一个质数(DAY 42)

7.5 线程等待终止
随机推荐
7.4 thread exit
Developing Cami community system with ThinkPHP
存储组 物理量 实体 路径
leetcode:440. 字典序的第K小数字
pytorch(五)——笔记
LeetCode_ 509 Fibonacci number
Brush classic topics
Ijcai2022 employment results released! The acceptance rate is 15%. Did you win?
leetcode:271. Encoding and decoding of strings
深度优先和广度优先的区别 笔记
Distributed GNS3
Matlab implementation of Gan network notes
[express agent operation] how to do cross-border e-commerce in 2022? Express will focus on three things this year
2022/4/21
TextView 倾斜属性
Following Huawei Cangjie, it reproduces four domestic programming languages in various forms, including one 0 code
Necessary skills for large factory interview, Android audio and video framework
5. Network structure and ISP, packet delay, loss, throughput
机器学习,深度学习,神经网络,深度神经网络之间有何区别?
How to set the motion stroke and angle in SolidWorks