当前位置:网站首页>Mysql environment installation under Linux (centos)
Mysql environment installation under Linux (centos)
2022-07-31 23:00:00 【Abing cloud native】
携手创作,共同成长!这是我参与「掘金日新计划 · 8 月更文挑战」的第4天,点击查看活动详情
linux The environment installation is relatively simple,But still encounter all kinds of strange problems,Let's sort it out
安装 mysql We will use the following address:
- Mysql 官方文档的地址,可以参考,Don't use them all
开始安装 mysql
- 卸载默认的 mysql
avoid existing mysql Affects what we're going to install now mysql
yum search mysql
yum remove mariadb.x86_64
复制代码
- 到 mysql 官网上下载 rpm
Of course, you can also execute the following commands directly,使用 wget 的方式将 rpm下载到我们 linux 环境中,如果要下载其他版本,可以修改 rpm 的具体名称 , For example, we are using this time mysql57-community-release-el7-11.noarch.rpm
wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
复制代码
- 本地安装 mysql yum 源
yum localinstall mysql
复制代码
- Check the corresponding ones that need to be installed mysql 版本,进行安装
yum search mysql
yum install mysql-community-server.x86_64
复制代码
- 检查安装是否成功
ps -ef | grep mysql
复制代码
- 启动 mysql,重启 mysql, 停止 mysql
service mysqld start
service mysqld restart
service mysqld stop
复制代码
- 查找默认密码
cat /var/log/mysqld.log | grep password
复制代码
- 登录 mysql
mysql -uroot -p 回车,然后输入密码
复制代码
登录之后,We can see these databases normally
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
6 rows in set (0.00 sec)
复制代码
- 修改密码
SET PASSWORD = PASSWORD('xxxx');
复制代码
- Permission to activate remote connection
- 选择 mysql 数据库,and query the current one user 表
use mysql;
show tables;
select host, user from user;
复制代码
- 更新 host 字段
update user set host="%" where Host='localhost' and user = "root";
flush privileges;
复制代码
更新完毕后,Let's check again user 表,You can see the effect of our update
select host, user from user;
复制代码
After installation, you can play happily
当然,If you are installing on a cloud server mysql ,If you want to access the cloud server on your own local machine mysql,Then remember to use the management interface of your corresponding server operator,将3306 端口打开,当然,It can also be mapped to other ports,As long as it meets our needs
Problems that may be encountered in actual operation
按照上面 10 个步骤来操作,无脑安装,Not bad if it goes well,If there is a problem,也别慌张,继续看
Some minor problems encountered are not recorded here,比较好解决,Record one here mysql 版本的问题
咱们在安装 mysql 的步骤中,可能会出现这样的问题
软件包:mysql-community-server-5.7.20-1.el6.x86_64 (mysql57-community)需要:libsasl2.so.2()(64bit)您可以尝试添加 --skip-broken 选项来解决该问题
复制代码
We can solve it this way
- 进入 vim mysql-community.repo
vim /etc/yum.repos.d/mysql-community.repo
复制代码
- 把 baseurl 中的 6 改成 7
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/
修改成
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/
复制代码
- 修改 gpgcheck 为 0 即可
关于 windows 下安装mysql 和 workbench Check out this historical article for installation
windows 下 mysql 和 mysql workbench基本环境安装
This article is for later 微服务 go-zero Quick practice as a foundation,It will be referenced directly later
今天就到这里,学习所得,若有偏差,还请斧正
欢迎点赞,关注,收藏
朋友们,你的支持和鼓励,是我坚持分享,提高质量的动力
好了,本次就到这里
技术是开放的,我们的心态,更应是开放的.拥抱变化,向阳而生,努力向前行.
我是阿兵云原生,欢迎点赞关注收藏,下次见~
边栏推荐
- Difference Between Stateless and Stateful
- 二叉树非递归遍历
- -xms -xmx(information value)
- 了解下C# 匿名方法
- useragent online lookup
- Judging decimal points and rounding of decimal operations in Golang
- [Code Hoof Set Novice Village 600 Questions] Merge two numbers without passing a character array
- C#中引用类型的变量做为参数在方法调用时加不加 ref 关键字的不同之处
- 景区手绘地图的绘制流程
- Design of Fire and Anti-theft System Based on Single Chip GSM
猜你喜欢
《ArchSummit:时代的呐喊,技术人听得到》
消息队列消息存储设计(架构实战营 模块八作业)
iNeuOS industrial Internet operating system, equipment operation and maintenance business and "low-code" form development tools
【Acwing】第62场周赛 题解
Golang - from entry to abandonment
Binary tree non-recursive traversal
Pytest first experience
如何减少软件设计和实现之间鸿沟
景区手绘地图的绘制流程
(26) About menu of the top menu of Blender source code analysis
随机推荐
Handwritten a simple web server (B/S architecture)
spark reports an error OutOfMemory "recommended collection"
什么是客户画像管理?
消息队列消息存储设计(架构实战营 模块八作业)
高等代数_证明_任何矩阵都相似于一个上三角矩阵
Interview assault 69: TCP reliable?Why is that?
《ArchSummit:时代的呐喊,技术人听得到》
TestCafeSummary
@JsonFormat(pattern="yyyy-MM-dd") time difference problem
The article you worked so hard to write may not be your original
如何减少软件设计和实现之间鸿沟
[QNX Hypervisor 2.2用户手册]9.16 system
MLP神经网络,GRNN神经网络,SVM神经网络以及深度学习神经网络对比识别人体健康非健康数据
基于simulink的Active anti-islanding-AFD主动反孤岛模型仿真
Verilog implements a divide-by-9 with a duty cycle of 5/18
Advanced Algebra _ Proof _ Any matrix is similar to an upper triangular matrix
20. Support vector machine - knowledge of mathematical principles
The difference between adding or not adding the ref keyword when a variable of reference type is used as a parameter in a method call in C#
输入输出优化
server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none failed