Linux 下 MySQL安装
1、下载安装包文件。
http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
2、安装
rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum install mysql-server
3、启动 mysql 服务
systemctl start mysqld.service #启动 mysql
systemctl restart mysqld.service #重启 mysql
systemctl stop mysqld.service #停止 mysql
systemctl enable mysqld.service #设置 mysql 开机启动
4、设置root密码
mysql -u root
mysql> use mysql;
mysql> update user set password=PASSWORD("123456") where User='root';
mysql> flush privileges;
5、设置远程登录
GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "123456";
文档更新时间: 2020-10-13 20:40 作者:超级管理员