当前位置:网站首页>CentOS7 - yum install mysql
CentOS7 - yum install mysql
2022-07-31 12:32:00 【m0_67391518】
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
边栏推荐
猜你喜欢

这款悄然崛起的国产API接口管理工具,你一定要晓得

WebGL给Unity传递参数问题1: Cannot read properties of undefined (reading ‘SendMessage‘)

kubernetes之服务发现

一文吃透哈希表

JVM 运行时数据区与JMM 内存模型详解

The 2nd activity of the TOGAF10 Standard Reading Club continues wonderfully, and the highlights will be reviewed!

分布式监视 Zabbix 和 Prometheus 到底怎么选?千万别用错了!

Different lower_case_table_names settings for server ('1') and data dictionary ('0') solution
尚硅谷–MySQL–基础篇(P1~P95)

AMBA APB学习记录(AMBA 2.0)
随机推荐
【CPU设计实战】简单流水线CPU设计
集群的安全模式
手撕Verilog PWM呼吸灯
FIFO深度计算学习记录(汇总)
如何正确地把服务器端返回的文件二进制流写入到本地保存成文件
vb.net 画曲线
Quickly learn database management
A40i/T3 uboot启动时对PMU部分初始化
PyQt5快速开发与实战10.2 复利计算 && 10.3 刷新博客点击量
函数递归1.0
系统集成项目管理工程师(软考中级)知识点总结【挣值分析】【关键路径】
FastAPI 封装一个通用的response
立一个flag
WPF中报错:“未将对象引用设置到对象的实例。”
ipv4和ipv6对比(IPV4)
How to correctly write the binary stream of the file returned by the server to the local file and save it as a file
集群中增加数据节点与退役数据节点
alert(1) (haozi.me)靶场练习
Encapsulation of conversion between Json and objects (Gson)
ESP8266-Arduino编程实例-PIR(被动红外)传感器驱动