今天突然发现本地的mysql可以通过任意用户名访问到其中两个数据库,为什么会这样?
如图一:任意用户名都可以访问到这两个数据库
如图二:用户名随意写,只要密码不写都可以访问,但写了后就不能登录成功
补充:
上面是昨天的提问,今天我再去登录的时候却发现不存在的用户名不能登录了,怎么这么奇怪?为什么昨天可以?
补充说明一下:
现在问题解决了,还是自己犯的小错误:
一是空用户名的话,就是任意用户名都可以访问,我之前一直以为对应空用户名才对,其实不是这样的;
二是它所对应的密码为空,所以,我输了密码就不能登录;
三是我删除空用户名用户后还是这样,因为没有重启mysql!!!!(哎,发现犯过几次这样的错误了!)
今天开电脑后,发现"正常"了,因为电脑“重启”了!
回复内容:
今天突然发现本地的mysql可以通过任意用户名访问到其中两个数据库,为什么会这样?
如图一:任意用户名都可以访问到这两个数据库
如图二:用户名随意写,只要密码不写都可以访问,但写了后就不能登录成功
补充:
上面是昨天的提问,今天我再去登录的时候却发现不存在的用户名不能登录了,怎么这么奇怪?为什么昨天可以?
补充说明一下:
现在问题解决了,还是自己犯的小错误:
一是空用户名的话,就是任意用户名都可以访问,我之前一直以为对应空用户名才对,其实不是这样的;
二是它所对应的密码为空,所以,我输了密码就不能登录;
三是我删除空用户名用户后还是这样,因为没有重启mysql!!!!(哎,发现犯过几次这样的错误了!)
今天开电脑后,发现"正常"了,因为电脑“重启”了!
你看看test数据库的用户权限,就是允许任何用户访问的。
用 root 账号登录,然后
select * from mysql.user \G
看看是不是有两列的 user 是空的。也就是任意用户。
正如justjavac所说的,test数据库的权限是完全开放的,因此存在一定的风险,线上数据库使用很可能会把这个库人为删除的~

ThesecrettokeepingaPHP-poweredwebsiterunningsmoothlyunderheavyloadinvolvesseveralkeystrategies:1)ImplementopcodecachingwithOPcachetoreducescriptexecutiontime,2)UsedatabasequerycachingwithRedistolessendatabaseload,3)LeverageCDNslikeCloudflareforservin

You should care about DependencyInjection(DI) because it makes your code clearer and easier to maintain. 1) DI makes it more modular by decoupling classes, 2) improves the convenience of testing and code flexibility, 3) Use DI containers to manage complex dependencies, but pay attention to performance impact and circular dependencies, 4) The best practice is to rely on abstract interfaces to achieve loose coupling.

Yes,optimizingaPHPapplicationispossibleandessential.1)ImplementcachingusingAPCutoreducedatabaseload.2)Optimizedatabaseswithindexing,efficientqueries,andconnectionpooling.3)Enhancecodewithbuilt-infunctions,avoidingglobalvariables,andusingopcodecaching

ThekeystrategiestosignificantlyboostPHPapplicationperformanceare:1)UseopcodecachinglikeOPcachetoreduceexecutiontime,2)Optimizedatabaseinteractionswithpreparedstatementsandproperindexing,3)ConfigurewebserverslikeNginxwithPHP-FPMforbetterperformance,4)

APHPDependencyInjectionContainerisatoolthatmanagesclassdependencies,enhancingcodemodularity,testability,andmaintainability.Itactsasacentralhubforcreatingandinjectingdependencies,thusreducingtightcouplingandeasingunittesting.

Select DependencyInjection (DI) for large applications, ServiceLocator is suitable for small projects or prototypes. 1) DI improves the testability and modularity of the code through constructor injection. 2) ServiceLocator obtains services through center registration, which is convenient but may lead to an increase in code coupling.

PHPapplicationscanbeoptimizedforspeedandefficiencyby:1)enablingopcacheinphp.ini,2)usingpreparedstatementswithPDOfordatabasequeries,3)replacingloopswitharray_filterandarray_mapfordataprocessing,4)configuringNginxasareverseproxy,5)implementingcachingwi

PHPemailvalidationinvolvesthreesteps:1)Formatvalidationusingregularexpressionstochecktheemailformat;2)DNSvalidationtoensurethedomainhasavalidMXrecord;3)SMTPvalidation,themostthoroughmethod,whichchecksifthemailboxexistsbyconnectingtotheSMTPserver.Impl


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SublimeText3 Chinese version
Chinese version, very easy to use
