[MDEV-28824] mariadb-secure-installation inform about test_ databases Created: 2022-06-13  Updated: 2022-06-28

Status: Open
Project: MariaDB Server
Component/s: Scripts & Clients
Affects Version/s: 10.6
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: MG Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: beginner-friendly


 Description   

Currently mariadb-secure-installation mentions the test db and offers to remove it but does not mention eg test_electricity database permissions.

echo "By default, MariaDB comes with a database named 'test' that anyone can"
echo "access.  This is also intended only for testing, and should be removed"
echo "before moving into a production environment."
echo
[...]
    echo $echo_n "Remove test database and access to it? [Y/n] $echo_c"

Suggest:

echo "By default, MariaDB comes with a database named 'test' that anyone can"
echo "access.  This is also intended only for testing, and should be removed"
echo "before moving into a production environment."
echo "These privileges extend to any database named with the 'test_' prefix."
echo

Also don't drop valid user created create grants:

    do_query "DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%'"

    do_query "DELETE FROM mysql.db WHERE user='' and (Db='test' OR Db='test\\_%')"

This will let the user keep such grants as:

grant all on `test_%`.* to 'testenv'@'localhost';


Generated at Thu Feb 08 10:03:45 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.