Hardening Mysql
1icasimpan@am2018:~$ sudo mysql_secure_installation
2
3Securing the MySQL server deployment.
4
5Connecting to MySQL using a blank password.
6
7VALIDATE PASSWORD PLUGIN can be used to test passwords
8and improve security. It checks the strength of password
9and allows the users to set only those passwords which are
10secure enough. Would you like to setup VALIDATE PASSWORD plugin?
11
12Press y|Y for Yes, any other key for No: Y
13
14There are three levels of password validation policy:
15
16LOW Length >= 8
17MEDIUM Length >= 8, numeric, mixed case, and special characters
18STRONG Length >= 8, numeric, mixed case, special characters and dictionary file
19
20Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 8
21
22Invalid option provided.
23
24There are three levels of password validation policy:
25
26LOW Length >= 8
27MEDIUM Length >= 8, numeric, mixed case, and special characters
28STRONG Length >= 8, numeric, mixed case, special characters and dictionary file
29
30Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2
31Please set the password for root here.
32
33New password:
34
35Re-enter new password:
36
37Estimated strength of the password: 100
38Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : Y
39By default, a MySQL installation has an anonymous user,
40allowing anyone to log into MySQL without having to have
41a user account created for them. This is intended only for
42testing, and to make the installation go a bit smoother.
43You should remove them before moving into a production
44environment.
45
46Remove anonymous users? (Press y|Y for Yes, any other key for No) : Y
47Success.
48
49
50Normally, root should only be allowed to connect from
51'localhost'. This ensures that someone cannot guess at
52the root password from the network.
53
54Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
55Success.
56
57By default, MySQL comes with a database named 'test' that
58anyone can access. This is also intended only for testing,
59and should be removed before moving into a production
60environment.
61
62
63Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
64 - Dropping test database...
65Success.
66
67 - Removing privileges on test database...
68Success.
69
70Reloading the privilege tables will ensure that all changes
71made so far will take effect immediately.
72
73Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
74Success.
75
76All done!
See https://www.techrepublic.com/article/how-to-harden-mysql-security-with-a-single-command/