CentOS7安装使用 MySQL
2018-03-12 本文已影响2人
史迪奇的博客
不多废话,直接硬操作。
一、安装
wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
rpm -ivh mysql57-community-release-el7-9.noarch.rpm
yum install mysql-server
二、启动
systemctl start mysqld
——查看 temporary Password
grep 'temporary password' /var/log/mysqld.log
三、配置
mysql_secure_installation
输入temporary Password,并修改密码
四、远程连接
例如,你想root使用123456从任何主机连接到mysql服务器。
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
