Opengist

Explore

  • All gists
  • Topics
  • Users
Give feedback on the new UI Powered by Opengist ⋅ 191ms

user:thomas gists created by user

title:mygist gists with given title

description:sync gists with given description

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

all:systemctl search all fields

Login
r

remote-access

Recently created Least recently created Recently updated Least recently updated

timmy / MySQL 設定 root 使用者權限與密碼

Last active 6 hours ago database mysql remote-access root security sql user-management

這段 MySQL 指令 用於 建立 root 帳戶並賦予全域權限,適用於 開放遠端連線的 MySQL 伺服器。

0 0 0 1
1 CREATE USER 'root'@'%' IDENTIFIED BY 'my_root_pwd';
2 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
3 FLUSH PRIVILEGES; -- 重新整理權限表
4
5 ALTER USER 'root'@'%' IDENTIFIED BY 'my_root_pwd';
6 FLUSH PRIVILEGES; -- 重新整理權限表