Hi, all.
I have encountered the strange problem in MySQL.
In the "MySQL-Databases" screen of Cpanel, even if it changes "Grant permissions on a MySQL database to a MySQL user", I have become with "Privileges: ALL PRIVILEGES".
So, it shows that Privileges is not changed.
When the log of MySQL is recorded, it looks like a cause that a backslash is added to the underbar (_) of a database name (Db), and the query is run.
How should I Fix this problem?
The following is record of the query at the time of changing "Grant permissions on a MySQL database to a MySQL user".
[MySQL Log]========================================================
5 Connect root_user@localhost on mysql
5 Query SET AUTOCOMMIT=1
5 Query FLUSH PRIVILEGES
5 Query show databases
5 Query select Host from user where User REGEXP "^username\_"
5 Query select Host from user where User='username'
5 Query replace into user (host,user,password) values('localhost','username',password('password'))
5 Query GRANT ALL ON `dbusername\_dbname`.* TO 'username'@localhost
5 Query FLUSH PRIVILEGES
5 Quit
6 Connect root_user@localhost on mysql
6 Query SET AUTOCOMMIT=1
6 Query select Host from user where User REGEXP "^username\_"
6 Query select Host from user where User='username'
6 Query FLUSH PRIVILEGES
6 Query GRANT CREATE,DELETE,SELECT,INSERT,UPDATE ON `username\_dbname`.* TO 'username_dbusername'@'localhost'
6 Query FLUSH PRIVILEGES
6 Query show databases
6 Query select Host from user where User REGEXP "^username\_"
6 Query select Host from user where User='username'
6 Query replace into user (host,user,password) values('localhost','username',password('password'))
6 Query GRANT ALL ON `username\_dbname`.* TO 'username'@localhost
6 Query FLUSH PRIVILEGES
6 Quit
========================================================
[select * from db;]========================================================
+-----------+----------------+----------------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+
| Host | Db | User | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Create_tmp_table_priv | Lock_tables_priv |
+-----------+----------------+----------------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+
| localhost | username_dbname | username | Y | Y | Y | Y | Y | Y | N | Y | Y | Y | Y | Y | <--- 1
| localhost | username\_dbname | username | Y | Y | Y | Y | Y | Y | N | Y | Y | Y | Y | Y | <--- 2
| localhost | username_dbname | username_dbusername | Y | Y | Y | Y | Y | Y | N | Y | Y | Y | Y | Y | <--- 3
| localhost | username\_dbname | username_dbusername | Y | Y | Y | Y | N | N | N | N | N | N | N | N | <--- 4
========================================================
I have encountered the strange problem in MySQL.
In the "MySQL-Databases" screen of Cpanel, even if it changes "Grant permissions on a MySQL database to a MySQL user", I have become with "Privileges: ALL PRIVILEGES".
So, it shows that Privileges is not changed.
When the log of MySQL is recorded, it looks like a cause that a backslash is added to the underbar (_) of a database name (Db), and the query is run.
How should I Fix this problem?
The following is record of the query at the time of changing "Grant permissions on a MySQL database to a MySQL user".
[MySQL Log]========================================================
5 Connect root_user@localhost on mysql
5 Query SET AUTOCOMMIT=1
5 Query FLUSH PRIVILEGES
5 Query show databases
5 Query select Host from user where User REGEXP "^username\_"
5 Query select Host from user where User='username'
5 Query replace into user (host,user,password) values('localhost','username',password('password'))
5 Query GRANT ALL ON `dbusername\_dbname`.* TO 'username'@localhost
5 Query FLUSH PRIVILEGES
5 Quit
6 Connect root_user@localhost on mysql
6 Query SET AUTOCOMMIT=1
6 Query select Host from user where User REGEXP "^username\_"
6 Query select Host from user where User='username'
6 Query FLUSH PRIVILEGES
6 Query GRANT CREATE,DELETE,SELECT,INSERT,UPDATE ON `username\_dbname`.* TO 'username_dbusername'@'localhost'
6 Query FLUSH PRIVILEGES
6 Query show databases
6 Query select Host from user where User REGEXP "^username\_"
6 Query select Host from user where User='username'
6 Query replace into user (host,user,password) values('localhost','username',password('password'))
6 Query GRANT ALL ON `username\_dbname`.* TO 'username'@localhost
6 Query FLUSH PRIVILEGES
6 Quit
========================================================
[select * from db;]========================================================
+-----------+----------------+----------------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+
| Host | Db | User | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Create_tmp_table_priv | Lock_tables_priv |
+-----------+----------------+----------------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+
| localhost | username_dbname | username | Y | Y | Y | Y | Y | Y | N | Y | Y | Y | Y | Y | <--- 1
| localhost | username\_dbname | username | Y | Y | Y | Y | Y | Y | N | Y | Y | Y | Y | Y | <--- 2
| localhost | username_dbname | username_dbusername | Y | Y | Y | Y | Y | Y | N | Y | Y | Y | Y | Y | <--- 3
| localhost | username\_dbname | username_dbusername | Y | Y | Y | Y | N | N | N | N | N | N | N | N | <--- 4
========================================================
Last edited: