安裝mariadb以及容許遠程訪問

  1. 下載mariadb:
    yum -y install mariadb-server mariadb
  2. 開啓mariadb服務:
    systemctl start mariadb
  3. 無密碼登陸mariadb:
    mysql
  4. 查看用戶表:
    select * from mysql.user\G
  5. 添加遠程訪問用戶:
    grant all on *.* to 'root'@'%' identified by '123456'
  6. 設置添加用戶的受權權限:
    update mysql.user set Grant_priv='Y' where Host='%'
  7. 移除匿名用戶:
    delete from mysql.user where Host<>'%' or User<>'root'
  8. 退出mariadb命令行:
    quit
  9. 重啓mariadb:
    systemctl restart mariadb
相關文章
相關標籤/搜索