当前位置:网站首页>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
今天就到这里,学习所得,若有偏差,还请斧正
欢迎点赞,关注,收藏
朋友们,你的支持和鼓励,是我坚持分享,提高质量的动力
好了,本次就到这里
技术是开放的,我们的心态,更应是开放的.拥抱变化,向阳而生,努力向前行.
我是阿兵云原生,欢迎点赞关注收藏,下次见~
边栏推荐
- Advanced Algebra _ Proof _ Any matrix is similar to an upper triangular matrix
- JS basic exercises
- Fixed-length usage of nanopb string type based on RT1052 Aworks (27)
- 22年8月推广大使额外奖励规则
- Difference Between Stateless and Stateful
- The uniapp applet checks and prompts for updates
- A high-quality WordPress download site template theme developed abroad
- Flutter教程之 02 Flutter 桌面程序开发入门教程运行hello world (教程含源码)
- 「SDOI2016」征途 题解
- Transfer Learning - Domain Adaptation
猜你喜欢
How to debug TestCafe
数据分析(一)——matplotlib
高等代数_证明_任何矩阵都相似于一个上三角矩阵
Shell常用脚本:Nexus批量上传本地仓库脚本
Daily practice——Randomly generate an integer between 1-100 and see how many times you can guess.Requirements: The number of guesses cannot exceed 7 times, and after each guess, it will prompt "bigger"
Unity - by casting and cloning method dynamic control under various UGUI create and display
Interview assault 69: TCP reliable?Why is that?
Student management system on the first day: complete login PyQt5 + MySQL5.8 exit the operation logic
网络安全--通过握手包破解WiFi(详细教程)
A high-quality WordPress download site template theme developed abroad
随机推荐
A solution to the server encountered an internal error that prevented it from fulfilling this request [easy to understand]
SQL27 View user details of different age groups
The uniapp applet checks and prompts for updates
"APIO2010" Patrol Problem Solution
Several methods for deleting specified elements in Golang slices
了解下C# 匿名方法
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#
Payment module implementation
Pytest first experience
(26) About menu of the top menu of Blender source code analysis
Input and output optimization
In Golang go-redis cluster mode, new connections are constantly created, and the problem of decreased efficiency is solved
flowable workflow all business concepts
UVM RAL model and built-in seq
Flutter教程之 02 Flutter 桌面程序开发入门教程运行hello world (教程含源码)
iNeuOS industrial Internet operating system, equipment operation and maintenance business and "low-code" form development tools
「SDOI2016」征途 题解
HTC使用官方固件作为底包制作rom卡刷包教程
Fixed-length usage of nanopb string type based on RT1052 Aworks (27)
支付模块实现