版权声明:博客原创,转载须标明出处 https://blog.csdn.net/qq_24232123/article/details/79782372
- # rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
- # yum repolist enabled | grep “mysql.-community.”
- # yum install mysql-community-server
- 中间安装软件一直:y
- 启动mysql:systemctl start mysqld 也可以用 service mysqld start
- 配置基本信息
mysql_secure_installation
Enter current password for root (enter for none): ----》默认为空密码直接回车
Set root password? [Y/n] y ----》设置root密码
New password:
Re-enter new password:
Remove anonymous users? [Y/n] y ----》禁止匿名访问
Disallow root login remotely? [Y/n] y ----》不允许root远程访问
Remove test database and access to it? [Y/n] y ----》删除测试数据库test
Reload privilege tables now? [Y/n] y ----》重新加载授权信息
- 启动 systemctl start mysqld 看状态 systemctl status mysqld 停止 service mysqld stop
- 配置远程登录
- 登录 mysql -uroot -p
- GRANT ALL PRIVILEGES ON . TO ‘root’@’%’ IDENTIFIED BY ‘123456’ WITH GRANT OPTION;
- FLUSH PRIVILEGES;刷新
- 重启mysql服务