当前位置:网站首页>CentOS7 - yum install mysql
CentOS7 - yum install mysql
2022-08-04 05:31:00 【Little things】
Check if mysql is installed on the system first
1
2
[[email protected] ~]#yum list installed mysql*
[[email protected] ~]#rpm –qa|grep mysql*
2. Check if there is an installation package
[[email protected] ~]#yum list mysql*
3. Install mysql client
[[email protected] ~]#yum install mysql
Note that mariab is installed by default here
4. Install mysql server (prompt)
Tip: If there is no error when entering this command, skip the following steps and continue to install the next server
[[email protected] ~]#yum install mysql-server
Note: The error here is that Mysql installation failed, and MariaDB is installed
Reason: CentOS7 comes with MariaDB instead of MySQL, MariaDB and MySQL are also Kaiyuan's database
5. Install mysql server (processing method) download MySQL source installation package
Go to the official website to view the latest installation package
https://dev.mysql.com/downloads/repo/yum/
Copy this download address and use wget to download to linux.
If the wget tool is not installed, use yum -y installwget to install it first.
Use wget + download address to download to Linux local, and then use yum to install.
Check the installation effect
yum repolist enabled | grep mysql.*
Install MySQL Server
yum -y install mysql-community-server
Start MySQL service
systemctl start mysqld.service
Run the command to check the running status
systemctl status mysqld.service
Initialize database password
Check the initial password
grep "password" /var/log/mysqld.log
Direct copy input password error
The reason is that ! is a special character and needs to be escaped and written as ! to be successfully recognized.
Login
mysql -uroot -p
Change password
ALTER USER 'root'@'localhost' IDENTIFIED BY '****************';
mysql has a password security check plug-in (validate_password) installed by default. The default password check policy requires that the password must contain: uppercase and lowercase letters, numbers and special symbols, and the length cannot be less than 8 characters.
Otherwise it will prompt ERROR 1819 (HY000): Your password does not satisfy the current policy requirements error
Six: Database Authorization
The database is not authorized, only supports localhost local access
mysql>GRANT ALL PRIVILEGES ON *.* TO?``'root'``@``'%'``IDENTIFIED BY?``'123456'``WITH GRANT OPTION;
//``You need to enter a username and password when connecting to the database remotely
Username: root
Password: 123456
Pointing ip:% represents all IPs, you can also input IP here to specify IP
The following statement is required for the modification to take effect after inputting
mysql>FLUSH PRIVILEGES;
Remote can also be achieved by modifying the table:
mysql -u root -pmysql> use mysql;mysql> update user set host = '%' where user = 'root';mysql> select host, user from user;
Seven: Set auto-start
systemctl enable mysqld
systemctl daemon-reload
8 Firewall Settings
Refer to thisCentOS7Install MySQL, modify the port - BlackManZhang - Blog Park
Let me introduce myself first. The editor graduated from Shanghai Jiaotong University in 2013. I worked in a small company and went to big factories such as Huawei and OPPO. I joined Alibaba in 2018, until now.I know that most junior and intermediate java engineers want to upgrade their skills, they often need to explore their own growth or sign up to study, but for training institutions, the tuition fee is nearly 10,000 yuan, which is really stressful.Self-learning that is not systematic is very inefficient and lengthy, and it is easy to hit the ceiling and the technology stops.Therefore, I collected a "full set of learning materials for java development" for everyone. The original intention is also very simple. I hope to help friends who want to learn by themselves but don't know where to start, and at the same time reduce everyone's burden.Add the business card below to get a full set of learning materials
边栏推荐
- 想低成本保障软件安全?5大安全任务值得考虑
- C专家编程 第4章 令人震惊的事实:数组和指针并不相同 4.3 什么是声明,什么是定义
- 去重的几种方式
- 深度学习21天——准备(环境配置)
- OpenGL绘制圆
- day13--postman interface test
- 3面头条,花7天整理了面试题和学习笔记,已正式入职半个月
- static在不同位置定义变量居然还有不同的含义?
- C Expert Programming Chapter 4 The Shocking Fact: Arrays and pointers are not the same 4.2 Why does my code not work
- System design. Seckill system
猜你喜欢
Do you think border-radius is just rounded corners?【Various angles】
解决错误:npm WARN config global `--global`, `--local` are deprecated
3面头条,花7天整理了面试题和学习笔记,已正式入职半个月
Grain Mall - Basics (Project Introduction & Project Construction)
Tactile intelligent sharing - SSD20X realizes upgrade display progress bar
【云原生--Kubernetes】Pod资源管理与探针检测
canal实现mysql数据同步
leetcode 12. 整数转罗马数字
某母婴小程序加密参数解密
DP4398:国产兼容替代CS4398立体声24位/192kHz音频解码芯片
随机推荐
力扣:62.不同路径
一个对象引用的思考
npm init [email protected] 构建项目报错SyntaxError: Unexpected token ‘.‘解决办法
[SemiDrive source code analysis] [MailBox inter-core communication] 47 - Analysis of RPMSG_IPCC_RPC mode limit size of single transmission and limit bandwidth test
C专家编程 第4章 令人震惊的事实:数组和指针并不相同 4.5 数组和指针的其他区别
What are the functions of mall App development?
Turn: Management is the love of possibility, and managers must have the courage to break into the unknown
Grain Mall - Basics (Project Introduction & Project Construction)
商城App开发都有哪些功能呢
【流程图】
代码重构:面向单元测试
npm报错Beginning October 4, 2021, all connections to the npm registry - including for package installa
[Evaluation model] Topsis method (pros and cons distance method)
[Cocos 3.5.2]开启模型合批
Landing, the IFC, GFC, FFC concept, layout rules, forming method, use is analysed
C语言 -- 操作符详解
谷粒商城-基础篇(项目简介&项目搭建)
MySQL数据库(基础)
System design. Seckill system
Dynamic programming of the division of numbers