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

版权声明:博客原创,转载须标明出处 https://blog.csdn.net/qq_24232123/article/details/79782372
  1. # rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
  2. # yum repolist enabled | grep “mysql.-community.
  3. # yum install mysql-community-server
  4. 中间安装软件一直:y
  5. 启动mysql:systemctl start mysqld 也可以用 service mysqld start
  6. 配置基本信息
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                           ----》重新加载授权信息
  1. 启动 systemctl start mysqld 看状态 systemctl status mysqld 停止 service mysqld stop
  2. 配置远程登录
  3. 登录 mysql -uroot -p
  4. GRANT ALL PRIVILEGES ON . TO ‘root’@’%’ IDENTIFIED BY ‘123456’ WITH GRANT OPTION;
  5. FLUSH PRIVILEGES;刷新
  6. 重启mysql服务

猜你喜欢

转载自blog.csdn.net/qq_24232123/article/details/79782372