12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
ADADADADAD
mysql数据库 时间:2024-11-25 13:37:29
作者:文/会员上传
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
1. 安装sudoapt-getupdatesudoapt-getinstall2. 数据库初始化sudo交互如下:SecuringtheMySQLserverdeployment.ConnectingtoMySQLusingablankpassword.VALIDATEPASSWORDPLUGI
以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。
sudoapt-getupdatesudoapt-getinstall
sudo
SecuringtheMySQLserverdeployment.ConnectingtoMySQLusingablankpassword.VALIDATEPASSWORDPLUGINcanbeusedtotestpasswordsandimprovesecurity.Itchecksthestrengthofpasswordandallowstheuserstosetonlythosepasswordswhicharesecureenough.WouldyouliketosetupVALIDATEPASSWORDplugin?Pressy|YforYes,anyotherkeyforNo:yTherearethreelevelsofpasswordvalidationpolicy:LOWLength>=8MEDIUMLength>=8,numeric,mixedcase,andspecialcharactersSTRONGLength>=8,numeric,mixedcase,specialcharactersanddictionaryfilePleaseenter0=LOW,1=MEDIUMand2=STRONG:2<=====注意这里一定要选2,STRONGPleasesetthepasswordforroothere.Newpassword:Re-enternewpassword:Estimatedstrengthofthepassword:100Doyouwishtocontinuewiththepasswordprovided?(Pressy|YforYes,anyotherkeyforNo):yBydefault,aMySQLinstallationhasananonymoususer,allowinganyonetologintoMySQLwithouthavingtohaveauseraccountcreatedforthem.Thisisintendedonlyfortesting,andtomaketheinstallationgoabitsmoother.Youshouldremovethembeforemovingintoaproductionenvironment.Removeanonymoususers?(Pressy|YforYes,anyotherkeyforNo):ySuccess.Normally,rootshouldonlybeallowedtoconnectfrom'localhost'.Thisensuresthatsomeonecannotguessattherootpasswordfromthenetwork.Disallowrootloginremotely?(Pressy|YforYes,anyotherkeyforNo):ySuccess.Bydefault,MySQLcomeswithadatabasenamed'test'thatanyonecanaccess.Thisisalsointendedonlyfortesting,andshouldberemovedbeforemovingintoaproductionenvironment.Removetestdatabaseandaccesstoit?(Pressy|YforYes,anyotherkeyforNo):y-Droppingtestdatabase...Success.-Removingprivilegesontestdatabase...Success.Reloadingtheprivilegetableswillensurethatallchangesmadesofarwilltakeeffectimmediately.Reloadprivilegetablesnow?(Pressy|YforYes,anyotherkeyforNo):ySuccess.Alldone!
Pleaseenter0=LOW,1=MEDIUMand2=
sudosystemctlstartmysql.servicesudosystemctlenablemysql.servicesudo
mysql>usemysql;mysql>selectUser,Host,pluginfromuser;+------------------+-----------+-----------------------+|User|Host|plugin|+------------------+-----------+-----------------------+|root|localhost|auth_socket<--这里||mysql.session|localhost|mysql_native_password||mysql.sys|localhost|mysql_native_password||debian-sys-maint|localhost|mysql_native_password|+------------------+-----------+-----------------------+mysql>updateusersetplugin='mysql_native_password'whereUser='root'andHost='localhost';mysql>GRANTALLPRIVILEGESON*.*TO'root'@'localhost';mysql>flushprivileges;
mysql>showvariableslike'char%';mysql>showvariableslike'collation%';sudovim/etc/mysql/conf.d/mysql.cnf[mysql]default-character-set=utf8sudovim/etc/mysql/mysql.conf.d/mysqld.cnf[mysqld]collation-server=utf8_general_cicharacter-set-server=utf8sudo
sudosystemctlstatusmysql.servicesudolsof-i:3306netstat-ntpl|grep
11-20
11-19
11-20
11-20
11-20
11-19
11-20
11-20
11-19
11-20
11-19
11-19
11-19
11-19
11-19
11-19