YES
Server operating system + version
Debian 13
Server virtualization technology used
KVM
KeyHelp version + build number
26.0 (Build 3618)
Problem description / error messages
If you got a Database with special chars, which will be escaped by SQL AND several IP addresses which should connect to the database, this happens as example if you want to give "1.1.1.1" and "2.2.2.2" and "3.3.3.3" access to "Test_DB" with the user "Test_DBu".. it gives for every next ip one \ more what is wrong... so it just works for the first host...:
Code: Select all
MariaDB [(none)]> SHOW GRANTS FOR 'Test_DBu'@'1.1.1.1';
+----------------------------------------------------------------------------------------------------------------------------+
| Grants for Test_DBu@1.1.1.1 |
+----------------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `Test_DBu`@`1.1.1.1` IDENTIFIED BY PASSWORD '*12345ABCD |
| GRANT ALL PRIVILEGES ON `Test\_DB`.* TO `Test_DBu`@`1.1.1.1` |
+----------------------------------------------------------------------------------------------------------------------------+
MariaDB [(none)]> SHOW GRANTS FOR 'Test_DBu'@'2.2.2.2';
+----------------------------------------------------------------------------------------------------------------------------+
| Grants for Test_DBu@2.2.2.2 |
+----------------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `Test_DBu`@`2.2.2.2` IDENTIFIED BY PASSWORD '*12345ABCD |
| GRANT ALL PRIVILEGES ON `Test\\_DB`.* TO `Test_DBu`@`2.2.2.2` |
+----------------------------------------------------------------------------------------------------------------------------+
MariaDB [(none)]> SHOW GRANTS FOR 'Test_DBu'@'3.3.3.3';
+----------------------------------------------------------------------------------------------------------------------------+
| Grants for Test_DBu@3.3.3.3 |
+----------------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `Test_DBu`@`3.3.3.3` IDENTIFIED BY PASSWORD '*12345ABCD |
| GRANT ALL PRIVILEGES ON `Test\\\_DB`.* TO `Test_DBu`@`3.3.3.3` |
+----------------------------------------------------------------------------------------------------------------------------+
Expected result
Code: Select all
MariaDB [(none)]> SHOW GRANTS FOR 'Test_DBu'@'1.1.1.1';
+----------------------------------------------------------------------------------------------------------------------------+
| Grants for Test_DBu@1.1.1.1 |
+----------------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `Test_DBu`@`1.1.1.1` IDENTIFIED BY PASSWORD '*12345ABCD |
| GRANT ALL PRIVILEGES ON `Test\_DB`.* TO `Test_DBu`@`1.1.1.1` |
+----------------------------------------------------------------------------------------------------------------------------+
MariaDB [(none)]> SHOW GRANTS FOR 'Test_DBu'@'2.2.2.2';
+----------------------------------------------------------------------------------------------------------------------------+
| Grants for Test_DBu@2.2.2.2 |
+----------------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `Test_DBu`@`2.2.2.2` IDENTIFIED BY PASSWORD '*12345ABCD |
| GRANT ALL PRIVILEGES ON `Test\_DB`.* TO `Test_DBu`@`2.2.2.2` |
+----------------------------------------------------------------------------------------------------------------------------+
MariaDB [(none)]> SHOW GRANTS FOR 'Test_DBu'@'3.3.3.3';
+----------------------------------------------------------------------------------------------------------------------------+
| Grants for Test_DBu@3.3.3.3 |
+----------------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `Test_DBu`@`3.3.3.3` IDENTIFIED BY PASSWORD '*12345ABCD |
| GRANT ALL PRIVILEGES ON `Test\_DB`.* TO `Test_DBu`@`3.3.3.3` |
+----------------------------------------------------------------------------------------------------------------------------+
Actual result
only 1.1.1.1 can connect to MySQL....
Steps to reproduce
shown above
Additional information
not needed
.