|
| 1 | +SET old_passwords=2; |
| 2 | +SELECT plugin into @plugin from mysql.user where user= 'root' and host='localhost'; |
| 3 | +SELECT password_last_changed into @plc from mysql.user where user= 'root' and host='localhost'; |
| 4 | +SELECT password into @pwd from mysql.user where user= 'root' and host='localhost'; |
| 5 | +SELECT authentication_string into @auth_str from mysql.user where user= 'root' and host='localhost'; |
| 6 | +update mysql.user set plugin= 'sha256_password', authentication_string= PASSWORD('123') where user='root' and host='localhost'; |
| 7 | +FLUSH PRIVILEGES; |
| 8 | +call mtr.add_suppression("Dictionary file not specified"); |
| 9 | +mysql_secure_installation: [Warning] Using a password on the command line interface can be insecure. |
| 10 | + |
| 11 | +Securing the MySQL server deployment. |
| 12 | + |
| 13 | + |
| 14 | +VALIDATE PASSWORD PLUGIN can be used to test passwords |
| 15 | +and improve security. It checks the strength of password |
| 16 | +and allows the users to set only those passwords which are |
| 17 | +secure enough. Would you like to setup VALIDATE PASSWORD plugin? |
| 18 | + |
| 19 | +Press y|Y for Yes, any other key for No: Using existing root password. |
| 20 | +Change the root password? (Press y|Y for Yes, any other key for No) : |
| 21 | + ... skipping. |
| 22 | +By default, a MySQL installation has an anonymous user, |
| 23 | +allowing anyone to log into MySQL without having to have |
| 24 | +a user account created for them. This is intended only for |
| 25 | +testing, and to make the installation go a bit smoother. |
| 26 | +You should remove them before moving into a production |
| 27 | +environment. |
| 28 | + |
| 29 | +Remove anonymous users? (Press y|Y for Yes, any other key for No) : |
| 30 | + ... skipping. |
| 31 | + |
| 32 | + |
| 33 | +Normally, root should only be allowed to connect from |
| 34 | +'localhost'. This ensures that someone cannot guess at |
| 35 | +the root password from the network. |
| 36 | + |
| 37 | +Disallow root login remotely? (Press y|Y for Yes, any other key for No) : |
| 38 | + ... skipping. |
| 39 | +By default, MySQL comes with a database named 'test' that |
| 40 | +anyone can access. This is also intended only for testing, |
| 41 | +and should be removed before moving into a production |
| 42 | +environment. |
| 43 | + |
| 44 | + |
| 45 | +Remove test database and access to it? (Press y|Y for Yes, any other key for No) : |
| 46 | + ... skipping. |
| 47 | +Reloading the privilege tables will ensure that all changes |
| 48 | +made so far will take effect immediately. |
| 49 | + |
| 50 | +Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Execution number 1 was successful |
| 51 | +mysql_secure_installation: [Warning] Using a password on the command line interface can be insecure. |
| 52 | + |
| 53 | +Securing the MySQL server deployment. |
| 54 | + |
| 55 | + |
| 56 | +VALIDATE PASSWORD PLUGIN can be used to test passwords |
| 57 | +and improve security. It checks the strength of password |
| 58 | +and allows the users to set only those passwords which are |
| 59 | +secure enough. Would you like to setup VALIDATE PASSWORD plugin? |
| 60 | + |
| 61 | +Press y|Y for Yes, any other key for No: |
| 62 | +There are three levels of password validation policy: |
| 63 | + |
| 64 | +LOW Length >= 8 |
| 65 | +MEDIUM Length >= 8, numeric, mixed case, and special characters |
| 66 | +STRONG Length >= 8, numeric, mixed case, special characters and dictionary file |
| 67 | + |
| 68 | +Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: Using existing root password. |
| 69 | + |
| 70 | +Estimated strength of the password: 0 |
| 71 | +Change the root password? (Press y|Y for Yes, any other key for No) : |
| 72 | +New password: |
| 73 | + |
| 74 | +Re-enter new password: |
| 75 | + |
| 76 | +Estimated strength of the password: 100 |
| 77 | +Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : By default, a MySQL installation has an anonymous user, |
| 78 | +allowing anyone to log into MySQL without having to have |
| 79 | +a user account created for them. This is intended only for |
| 80 | +testing, and to make the installation go a bit smoother. |
| 81 | +You should remove them before moving into a production |
| 82 | +environment. |
| 83 | + |
| 84 | +Remove anonymous users? (Press y|Y for Yes, any other key for No) : Success. |
| 85 | + |
| 86 | + |
| 87 | +Normally, root should only be allowed to connect from |
| 88 | +'localhost'. This ensures that someone cannot guess at |
| 89 | +the root password from the network. |
| 90 | + |
| 91 | +Disallow root login remotely? (Press y|Y for Yes, any other key for No) : Success. |
| 92 | + |
| 93 | +By default, MySQL comes with a database named 'test' that |
| 94 | +anyone can access. This is also intended only for testing, |
| 95 | +and should be removed before moving into a production |
| 96 | +environment. |
| 97 | + |
| 98 | + |
| 99 | +Remove test database and access to it? (Press y|Y for Yes, any other key for No) : - Dropping test database... |
| 100 | +Success. |
| 101 | + |
| 102 | + - Removing privileges on test database... |
| 103 | +Success. |
| 104 | + |
| 105 | +Reloading the privilege tables will ensure that all changes |
| 106 | +made so far will take effect immediately. |
| 107 | + |
| 108 | +Reload privilege tables now? (Press y|Y for Yes, any other key for No) : INSERT INTO mysql.user SELECT LOWER(@@hostname),'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'mysql_native_password','','N',@password,NULL; |
| 109 | +REPLACE INTO mysql.user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'mysql_native_password','','N',@password,NULL); |
| 110 | +REPLACE INTO mysql.user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'mysql_native_password','','N',@password,NULL); |
| 111 | +REPLACE INTO mysql.user VALUES ('::1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'mysql_native_password','','N',@password,NULL); |
| 112 | +INSERT INTO mysql.db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y','Y'); |
| 113 | +INSERT INTO mysql.db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y','Y'); |
| 114 | +UNINSTALL PLUGIN validate_password; |
| 115 | +UPDATE mysql.user SET password=@pwd, password_last_changed=@plc, authentication_string=@auth_str, plugin= @plugin; |
| 116 | +FLUSH PRIVILEGES; |
| 117 | +CREATE DATABASE test; |
0 commit comments