当前位置:网站首页>How to Install MySQL on Linux
How to Install MySQL on Linux
2022-07-31 08:29:00 【bsegebr】
Directory
Start installation
1. Create a mysql file installation directory
mkdir /opt/mysqlEnter this directory
cd /opt/mysql/2. Install mysql
wget http://dev.mysql.com/get/mysql-5.7.26-1.el7.x86_64.rpm-bundle.tarUnzip the file
tar -xvf mysql-5.7.26-1.el7.x86_64.rpm-bundle.tar3. Delete the built-in database mariadb (if there is one on the virtual machine, no matter if it is not), it will conflict with mysql.
First execute the following command to see if it exists
rpm -qa | grep mariIf it exists, execute the following commands in sequence to delete
rpm -e --nodeps mariadb-libsrpm -e --nodeps marisa4. Start installing mysql and execute the following commands in sequence
rpm -ivh mysql-community-common-5.7.26-1.el7.x86_64.rpmrpm -ivh mysql-community-libs-5.7.26-1.el7.x86_64.rpmrpm -ivh mysql-community-client-5.7.26-1.el7.x86_64.rpmrpm -ivh mysql-community-server-5.7.26-1.el7.x86_64.rpmNote: When executing the last command, an error may be reported:
Solution: Execute the command to install libaio
yum install libaioThen execute the command again
rpm -ivh mysql-community-server-5.7.26-1.el7.x86_64.rpm5. Start mysql
systemctl start mysqld.service6.mysql automatically sets a random password for the root user, run the command to view the current password
grep "password" /var/log/mysqld.log
7. Use the password found above to enter mysql
mysql -u root -p8. Modify the password, and then execute the following command to make the password setting take effect (the local virtual machine can be set simpler, ECS recommends setting a complex password, and personally experience the database on the laboratory server being hacked)
set password for 'root'@'localhost'=password('root');flush privileges;Test if the installation was successful
Exit mysql and enter with the reset password
exit
At this time, if you use Navicat to connect to the serverThe database may fail
ECS please enter the security group to open port 3306, the local virtual machine does not need to worry about this problem
If the port has been opened, the problem may be as follows:

Solution:
First enter mysql on the virtual machine, and then execute the following commands in sequenceuse mysql;
SELECT Host, User FROM user;
UPDATE userSET Host = '%' WHERE User = 'root';
flush privileges;

Then reconnect with Navicat again.
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
边栏推荐
- Open Source | Commodity Recognition Recommender System
- Machine Learning - Notes and Implementation of Linear Regression, Logistic Regression Problems
- Ubuntu安装Mysql5.7
- 循环结构--for循环
- Vulkan与OpenGL对比——Vulkan的全新渲染架构
- Practical Bioinformatics 2: Multi-omics data integration and mining
- 报销流程|By天放师兄
- 《C语言小游戏》扫雷
- [Interview: Concurrency 38: Multithreading: Thread Pool] Basic concepts of the ThreadPoolExecutor class
- Visual Studio新功能出炉:低优先级构建
猜你喜欢

【云原生与5G】微服务加持5G核心网

【MySQL功法】第3话 · MySQL中常见的数据类型

Flutter Paystack 所有选项实现

SQL 入门之第一讲——MySQL 8.0.29安装教程(windows 64位)

PHP中 比较 0、false、null,‘‘ “

Super detailed mysql database installation guide

进程调度的基本过程

【小程序项目开发-- 京东商城】uni-app之自定义搜索组件(下) -- 搜索历史

"The C language games" mine clearance

全国中职网络安全B模块之国赛题远程代码执行渗透测试 PHPstudy的后门漏洞分析
随机推荐
【idea 报错】 无效的目标发行版:17 的解决参考
【MySQL功法】第2话 · 数据库与数据表的基本操作
一文搞定代码中的命名
功能强大的国产Api管理工具
regex bypass
《如何戒掉坏习惯》读书笔记
【小程序专栏】总结uniapp开发小程序的开发规范
如何在一台机器上(windows)安装两个MYSQL数据库
《c语言》青蛙跳台阶递归问题
LED flashing on CY7C68013A
The Spark run on Yarn Spark application
35-Jenkins-共享库应用
SQLAlchemy使用教程
Navicat new database
普通函数的参数校验
MySQL安装常见报错处理大全
SQL语句知识大全
信息收集-DNS
报销流程|By天放师兄
Super detailed mysql database installation guide