时间:2020-03-02来源:电脑系统城作者:电脑系统城
1、下载 YUM 仓库文件
# wget https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
2、安装 YUM Repo 文件
# yum localinstall mysql80-community-release-el7-1.noarch.rpm
3、 选择具体的版本
5.5 5.6 5.7 8.0
// 查看 YUM 仓库关于 MySQL 的所有仓库列表
# yum repolist all | grep mysql
// 只查看启用的
# yum repolist enabled | grep mysql
// 安装 YUM 管理工具包,此包提供了 yum-config-manager 命令工具
# yum install yum-utils
// 禁用 8.0
# yum-config-manager --disable mysql80-community
// 启用 5.5
# yum-config-manager --enable mysql55-community
再次确认启用的 MySQL 仓库
# yum repolist enabled | grep mysql
4、 开始安装 MySQL
# yum install -y mysql-community-server
5、 管理 MySQL 服务
// 启动
# systemctl start mysqld.service
// 查看状态
# systemctl status mysqld.service
// 开机自启动
# systemctl enable mysqld.server
// 查看监听端口,默认 3306
# ss -natl |grep 3306
6、打开mysql
# mysql
7、修改root用户的密码
方法1: 用SET PASSWORD命令
首先登录MySQL。
格式:mysql> set password for 用户名@localhost = password('新密码');
例子:mysql> set password for root@localhost = password('123');
方法2:用mysqladmin
格式:mysqladmin -u用户名 -p旧密码 password 新密码
例子:mysqladmin -uroot -p123456 password 123
方法3:用UPDATE直接编辑user表
首先登录MySQL。
mysql> use mysql;
mysql> update user set password=password('123') where user='root' and host='localhost';
mysql> flush privileges;
8、CENTOS7中Mysql不能远程连接解决办法
(1)在装有MySQL的机器上登录MySQL。 mysql -u root -p 密码
(2)执行use mysql;
(3)执行update user set host = '%' where user = 'root';这一句执行完可能会报错,不用管它。
(4)执行FLUSH PRIVILEGES;
2023-03-19
Centos 7.9安装MySQL8.0.32的详细教程2023-03-19
一步步教你利用Mysql存储过程造百万级数据2023-03-19
利用Mysql定时+存储过程创建临时表统计数据的过程问题描述:MYSQL version 5.6.8command 表结构 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 CREATE TABLE command ( ID INT NOT NULL, NAME VARCHAR(16), D...
2023-03-19
一、Galera Cluster 二、基础环境搭建 三、加入配置参数启动集群 四、 测试 五、ProxySql...
2023-03-17