質問するログイン新規登録

回答編集履歴

2

追記

2017/05/28 08:59

投稿

tkmtmkt
tkmtmkt

スコア1800

answer CHANGED
@@ -25,4 +25,14 @@
25
25
  | GRANT ALL PRIVILEGES ON *.* TO 'hoge'@'localhost' |
26
26
  +---------------------------------------------------+
27
27
  1 row in set (0.00 sec)
28
+
29
+ MariaDB [(none)]> SELECT `Host`,`Db`,`User` FROM mysql.db;
30
+ +-----------+---------+---------+
31
+ | Host | Db | User |
32
+ +-----------+---------+---------+
33
+ | % | test | |
34
+ | % | test\_% | |
35
+ | localhost | redmine | redmine |
36
+ +-----------+---------+---------+
37
+ 3 rows in set (0.02 sec)
28
38
  ```

1

追記

2017/05/28 08:59

投稿

tkmtmkt
tkmtmkt

スコア1800

answer CHANGED
@@ -2,4 +2,27 @@
2
2
 
3
3
  `hoge@localhost`と`@localhost`は別のユーザになるので、権限がないのは正常な状態です。
4
4
 
5
- ログイン時のコマンドを見直してみてはどうでしょう。
5
+ ログイン時のコマンドを見直してみてはどうでしょう。
6
+
7
+ **【補足】**
8
+
9
+ 念のため確認したところ、以下のようになりました。
10
+
11
+ ```
12
+ $ mysql -u hoge
13
+ Welcome to the MariaDB monitor. Commands end with ; or \g.
14
+ Your MariaDB connection id is 129
15
+ Server version: 5.5.52-MariaDB MariaDB Server
16
+
17
+ Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
18
+
19
+ Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
20
+
21
+ MariaDB [(none)]> show grants;
22
+ +---------------------------------------------------+
23
+ | Grants for hoge@localhost |
24
+ +---------------------------------------------------+
25
+ | GRANT ALL PRIVILEGES ON *.* TO 'hoge'@'localhost' |
26
+ +---------------------------------------------------+
27
+ 1 row in set (0.00 sec)
28
+ ```