# 付与済みの権限の確認 mysql> show grants for 'user1'@'192.168.4.10'; +--------------------------------------------------------------------------------------------------------------------+ | Grants for user1@192.168.4.10 | +--------------------------------------------------------------------------------------------------------------------+ | GRANT USAGE ON *.* TO 'user1'@'192.168.4.10' IDENTIFIED BY PASSWORD '*EFCDCAF0F0A39E39459EB2XCFDREWOKSIX1D' | | GRANT ALL PRIVILEGES ON `my_shop_app_development`.* TO 'user1'@'192.168.4.10' | | GRANT ALL PRIVILEGES ON `my_shop_app_production`.* TO 'user1'@'192.168.4.10' | +--------------------------------------------------------------------------------------------------------------------+ 3 rows in set (0.00 sec) # ログインはできるので、新しいデータベースの使用権限を追加 mysql> GRANT ALL PRIVILEGES ON `my_blog_production`.* TO 'user1'@'192.168.4.10'; Query OK, 0 rows affected (0.16 sec) # 追加できた mysql> show grants for 'user1'@'192.168.4.10'; +--------------------------------------------------------------------------------------------------------------------+ | Grants for user1@192.168.4.10 | +--------------------------------------------------------------------------------------------------------------------+ | GRANT USAGE ON *.* TO 'user1'@'192.168.4.10' IDENTIFIED BY PASSWORD '*EFCDCAF0F0A39E39459EB2XCFDREWOKSIX1D' | | GRANT ALL PRIVILEGES ON `my_blog_production`.* TO 'user1'@'192.168.4.10' | | GRANT ALL PRIVILEGES ON `my_shop_app_development`.* TO 'user1'@'192.168.4.10' | | GRANT ALL PRIVILEGES ON `my_shop_app_production`.* TO 'user1'@'192.168.4.10' | +--------------------------------------------------------------------------------------------------------------------+ 4 rows in set (0.00 sec)
2019年1月31日木曜日
MySQL 外部サーバからのアクセス権限追加
登録:
コメントの投稿 (Atom)
0 件のコメント:
コメントを投稿