A Unix socket file is used if you do not specify a host name or if you specify the special host name localhostmysql連接的時候沒有指定hostname或者指定-h是 localhost的時候使用的是socket連接方式所以如果沒有創建localhost對應的賬號,mysql -uaccount -p 登錄的時候會報錯
root賦權
grant all PRivileges on *.* to root@'127.0.0.1' identified by 'WLjd@32lcx0';
監控賬號
grant process, replication client on *.* to devops_monitor@'192.168.88.%' identified by 'WLjd@32lcx0';
這里一般用作zabbix監控或者腳本監控的時候使用的賬號和權限
只讀和查詢賬號
grant select on db.* to checkdata@'192.168.88.%' identified by 'WLjd@32lcx0';
主從同步賬號
grant replication slave on *.* to rep@'192.168.88.%' identified by 'WLjd@32lcx0';