12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
ADADADADAD
mysql数据库 时间:2024-11-28 13:02:35
作者:文/会员上传
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
1、下载 YUM 仓库文件# wget https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm2、安装 YUM Repo 文件# yum localinstall mysql80-community-release
以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。
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;
11-20
11-19
11-20
11-20
11-20
11-19
11-20
11-20
11-19
11-20
11-19
11-19
11-19
11-19
11-19
11-19