当前位置:网站首页>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
今天就到这里,学习所得,若有偏差,还请斧正
欢迎点赞,关注,收藏
朋友们,你的支持和鼓励,是我坚持分享,提高质量的动力
好了,本次就到这里
技术是开放的,我们的心态,更应是开放的.拥抱变化,向阳而生,努力向前行.
我是阿兵云原生,欢迎点赞关注收藏,下次见~
边栏推荐
- A solution to the server encountered an internal error that prevented it from fulfilling this request [easy to understand]
- [Code Hoof Set Novice Village 600 Questions] Leading to the combination of formulas and programs
- MySQL数据库‘反斜杠\’ ,‘单引号‘’,‘双引号“’,‘null’无法存储
- 【Acwing】The 62nd Weekly Game Solution
- [QNX Hypervisor 2.2用户手册]9.16 system
- 什么是客户画像管理?
- server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none failed
- Shell常用脚本:Nexus批量上传本地仓库增强版脚本(强烈推荐)
- Weekly Summary
- flowable workflow all business concepts
猜你喜欢

高等代数_证明_任何矩阵都相似于一个上三角矩阵

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

基于simulink的Active anti-islanding-AFD主动反孤岛模型仿真

消息队列消息存储设计(架构实战营 模块八作业)

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#

Chapter Six
I don't know what to do with sync issues

A high-quality WordPress download site template theme developed abroad

IDA PRO中汇编结构体识别

Advanced Algebra _ Proof _ Any matrix is similar to an upper triangular matrix
随机推荐
二叉树非递归遍历
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#
@JsonFormat(pattern=“yyyy-MM-dd“)时间差问题
IDA PRO中汇编结构体识别
Shell common scripts: Nexus batch upload local warehouse enhanced version script (strongly recommended)
消息队列存储消息数据的MySQL表格
【Acwing】第62场周赛 题解
#yyds干货盘点# 面试必刷TOP101:链表中环的入口结点
SQL注入 Less46(order by后的注入+rand()布尔盲注)
Learn about C# anonymous methods
Write a database document management tool based on WPF repeating the wheel (1)
Drawing process of hand-drawn map of scenic spots
#yyds dry goods inventory# Interview must brush TOP101: the entry node of the ring in the linked list
TestCafeSummary
[QNX Hypervisor 2.2 User Manual]9.16 system
Dry goods | 10 tips for MySQL add, delete, change query performance optimization
基于单片机GSM的防火防盗系统的设计
手写一个简单的web服务器(B/S架构)
[Code Hoof Set Novice Village 600 Questions] Leading to the combination of formulas and programs
Unity-LineRenderer显示一条线