跳到主要內容

MYSQL的一些基本操作

MYSQL的一些基本操作
使用 root 登入本機 MySQL
mysql -u root -p

使用 root 登入遠端 MySQL
mysql -h (
遠端IP) -u root -p

建立 MySQL 新帳號,
create user 'newuser'@'%' identified by 'password';

設定select權限
grant select on database_name.* to 'newuser'@'%';

設定自訂權限
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE ON database_name.* TO 'newuser'@’%’;

設定所有權限
grant all on database_name.* to 'newuser'@'%';

顯示所有User
SELECT User,Host FROM mysql.user;

刪除帳戶
delete from mysql.user where user='newuser';

移除 MySQL 帳號權限
revoke all privileges on *.* from 'newuser';

查詢 newuser 的權限
SHOW grants for 'newuser';

留言

這個網誌中的熱門文章

基隆望幽谷

基隆望幽谷, 就在八斗子 忘憂谷 , 穿過像宮崎駿風之谷般的山谷, 迎接而來的是藍海、山谷與島嶼, 走在山谷的步道上,你可以遠望基隆嶼與海洋。   https://www.pexels.com/zh-tw/photo/10093017/     https://www.pexels.com/zh-tw/photo/10093006/     https://www.pexels.com/zh-tw/photo/10092822/     https://www.pexels.com/zh-tw/photo/10093057/  
志良辭官 為官權勢利名之, 反覆風雲嘆不如, 媒體今昔竟大異。 是非曲直有誰知? 2010/03/10 09:07 2010/3/8衛生署署長楊 志良因健保費調漲費率與吳敦義不合而辭官

如何設定spring Boot的 SSL憑證

在安裝 spring Boot 的工作目錄裡 1. 上傳 .p12 格式的憑證到 spring Boot 的工作目錄裡的 keystore 目錄 2. 找到   application.properties 設定檔 加入底下設定 # Server Port server.port=443 # The format used for the keystore. It could be set to JKS in case it is a JKS file server.ssl.key-store-type=PKCS12 # The path to the keystore containing the certificate server.ssl.key-store=keystore/twcassl.p12 # The password used to generate the certificate server.ssl.key-store-password=[here is yourpassword] # The alias mapped to the certificate server.ssl.key-alias=twcassl 參考文件 1.      https://www.baeldung.com/spring-boot-https-self-signed-certificate 2.      https://docs.spring.io/spring-boot/docs/1.2.3.RELEASE/reference/html/howto-embedded-servlet-containers.html