MySQL是一種常用的關系型數(shù)據(jù)庫管理系統(tǒng),用于存儲和管理數(shù)據(jù),被廣泛應用于各種Web應用程序、企業(yè)級解決方案和云計算平臺。在使用MySQL之前,我們需要進行初始設置,并設置管理員密碼。
$ sudo systemctl start mysql #啟動MySQL服務 $ sudo systemctl enable mysql #設置開機自啟動 $ sudo mysql_secure_installation #進行MySQL的安全設置 Securing the MySQL server deployment. Connecting to MySQL using a blank password. VALIDATE PASSWORD COMPONENT can be used to test passwords and improve security. It checks the strength of password and allows the users to set only those passwords which are secure enough. Would you like to setup VALIDATE PASSWORD component? Press y|Y for Yes, any other key for No: y There are three levels of password validation policy: LOW Length >= 8 MEDIUM Length >= 8, numeric, mixed case, and special characters STRONG Length >= 8, numeric, mixed case, special characters and dictionary file Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2 Please set the password for root here. New password: Re-enter new password: Estimated strength of the password: 100 Do you wish to continue with the password provided?(Press y|Y for Yes, any otherkey for No) : y By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? (Press y|Y for Yes, any other key for No) : y Success. Normally, root should only be allowed to connect from 'localhost'. This ensures the person executing the command is at the same location as the mysqld process. Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y Success. By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y - Dropping test database... Success. - Removing privileges on test database... Success. Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y Success. All done!
在進行MySQL安全設置的過程中,我們需要設置管理員密碼、刪除默認的匿名用戶和測試數(shù)據(jù)庫,并且禁止遠程連接MySQL數(shù)據(jù)庫管理系統(tǒng)。通過這些步驟,我們可以保證MySQL在使用過程中達到一定的安全性。
上一篇css中圖片放在文字中間
下一篇css中圖片怎么頂端對齊