当前位置:网站首页>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
今天就到这里,学习所得,若有偏差,还请斧正
欢迎点赞,关注,收藏
朋友们,你的支持和鼓励,是我坚持分享,提高质量的动力
好了,本次就到这里
技术是开放的,我们的心态,更应是开放的.拥抱变化,向阳而生,努力向前行.
我是阿兵云原生,欢迎点赞关注收藏,下次见~
边栏推荐
- In Golang go-redis cluster mode, new connections are constantly created, and the problem of decreased efficiency is solved
- SQL注入 Less42(POST型堆叠注入)
- Transfer Learning - Domain Adaptation
- BOW/DOM (top)
- SQL27 View user details of different age groups
- ECCV 2022 Huake & ETH propose OSFormer, the first one-stage Transformer framework for camouflaging instance segmentation!The code is open source!...
- UOS - WindTerm use
- 消息队列存储消息数据的MySQL表格
- 「SDOI2016」征途 题解
- 手写一个简单的web服务器(B/S架构)
猜你喜欢

Binary tree non-recursive traversal

【Acwing】第62场周赛 题解
Dry goods | 10 tips for MySQL add, delete, change query performance optimization

GateWay implements load balancing

Document management and tools in the development process

Go mode tidy reports an error go warning “all” matched no packages

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

Bika LIMS open source LIMS set - use of SENAITE (detection process)

消息队列存储消息数据的MySQL表格

Collation of knowledge points in Ningbo University NBU IT project management final exam
随机推荐
Summary of the classic drawing method of histogram
Pytest first experience
编程语言是什么
无状态与有状态的区别
BOW/DOM (top)
TestCafeSummary
基于simulink的Active anti-islanding-AFD主动反孤岛模型仿真
[QNX Hypervisor 2.2用户手册]9.16 system
新产品如何进行网络推广?
UOS统信系统 - WindTerm使用
【FPGA教程案例43】图像案例3——通过verilog实现图像sobel边缘提取,通过MATLAB进行辅助验证
21. Support Vector Machine - Introduction to Kernel Functions
In Golang go-redis cluster mode, new connections are constantly created, and the problem of decreased efficiency is solved
10大主流3D建模技术
一文带你了解 Grafana 最新开源项目 Mimir 的前世今生
二叉树非递归遍历
[Code Hoof Set Novice Village 600 Questions] Merge two numbers without passing a character array
Shell common script: Nexus batch upload local warehouse script
Niuke.com brush questions (1)
A solution to the server encountered an internal error that prevented it from fulfilling this request [easy to understand]