当前位置:网站首页>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
今天就到这里,学习所得,若有偏差,还请斧正
欢迎点赞,关注,收藏
朋友们,你的支持和鼓励,是我坚持分享,提高质量的动力
好了,本次就到这里
技术是开放的,我们的心态,更应是开放的.拥抱变化,向阳而生,努力向前行.
我是阿兵云原生,欢迎点赞关注收藏,下次见~
边栏推荐
- 高等代数_证明_任何矩阵都相似于一个上三角矩阵
- Daily--Kali opens SSH (detailed tutorial)
- 基于单片机GSM的防火防盗系统的设计
- Shell common scripts: Nexus batch upload local warehouse enhanced version script (strongly recommended)
- Interview assault 69: TCP reliable?Why is that?
- Golang - from entry to abandonment
- ThreadLocal
- Flutter教程之四年开发经验的高手给的建议
- The latest masterpiece!Alibaba just released the interview reference guide (Taishan version), I just brushed it for 29 days
- HTC使用官方固件作为底包制作rom卡刷包教程
猜你喜欢

VOT2021比赛简介

What is customer profile management?

The article you worked so hard to write may not be your original

《ArchSummit:时代的呐喊,技术人听得到》

Collation of knowledge points in Ningbo University NBU IT project management final exam

C#中引用类型的变量做为参数在方法调用时加不加 ref 关键字的不同之处

(26)Blender源码分析之顶层菜单的关于菜单

ICML2022 | 深入研究置换敏感的图神经网络

Unity - LineRenderer show a line

TestCafeSummary
随机推荐
SQL injection Less38 (stack injection)
SQL注入 Less47(报错注入) 和Less49(时间盲注)
Pytest初体验
Dry goods | 10 tips for MySQL add, delete, change query performance optimization
基于simulink的Passive anti-islanding-UVP/OVP and UFP/OFP被动反孤岛模型仿真
「APIO2010」巡逻 题解
SQL injection Less46 (injection after order by + rand() Boolean blind injection)
Shell common script: Nexus batch upload local warehouse script
不知道该怎么办的同步问题
《ArchSummit:时代的呐喊,技术人听得到》
Flink_CDC construction and simple use
Flex layout in detail
uniapp小程序检查、提示更新
MLP神经网络,GRNN神经网络,SVM神经网络以及深度学习神经网络对比识别人体健康非健康数据
10大主流3D建模技术
LeetCode 第 304 场周赛
GateWay implements load balancing
周总结
(26) About menu of the top menu of Blender source code analysis
Recognize anomalies (you will understand after reading this)