centos 7.4安装mysql
程序员文章站
2022-06-11 16:14:01
...
1.下载安装包
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
2.运行安装包
yum -y install mysql57-community-release-el7-10.noarch.rpm
3.安装数据库,这步可能会花些时间,安装完成后就会覆盖掉之前的mariadb。
yum -y install mysql-community-server
4.启动服务
systemctl start mysqld.service
5.找密码
grep “password” /var/log/mysqld.log
内容如下:
2019-10-16T04:24:00.078079Z 1 [Note] A temporary password is generated for [email protected]
localhost: oQ+-SPrhh4Bu
6.登录mysql并输入密码
mysql -uroot -p
7.修改密码
ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘123456’;
如果报:Your password does not satisfy the current policy requirements
可以查看:https://blog.csdn.net/wudinaniya/article/details/79378635的详解
8.修改远程访问密码
grant all privileges on . to ‘root’@’%’ identified by ‘123456’ with grant option;
flush privileges;
推荐阅读
-
redhat7.1 安装mysql 5.7.10步骤详解(图文详解)
-
win2003 安装2个mysql实例做主从同步服务配置
-
ThinkPHP框架搭建及常见问题(XAMPP安装失败、Apache/MySQL启动失败)
-
CentOS下安装mysql时忘记设置root密码致无法登录的解决方法
-
Mysql 主从数据库同步(centos篇)
-
CentOS 7.2下MySQL的安装与相关配置
-
mysql 5.6.14 win32 解压缩版(免安装)安装配置教程
-
CentOS中mysql cluster安装部署教程
-
mysql 5.7.14 免安装版注意事项(精)
-
MySQL5.7.14下载安装图文教程及MySQL数据库语句入门大全