您的位置:首页 > 运维架构 > Linux

Linux(centos7.3)安装mysql 对外使用

2018-04-01 21:59 471 查看
# 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服务
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: