Home >Database >Mysql Tutorial >centos中找回MariaDB数据库root用户权限的方法_MySQL

centos中找回MariaDB数据库root用户权限的方法_MySQL

WBOY
WBOYOriginal
2016-06-01 13:06:53779browse

MariaDBCentOS

前几天在网上闲逛,看到一文章,说MySQL自被Orcle收入囊中,有弃MySQL社区开源之意,且把MySQL分成社区与企业版.我日他先人板板,都是钱TM惹祸.MySQL创始人另起人马,创MariaDB,据传以其次女名名之.一时手溅,在centos上废MySQL立MariaDB.

昨日休息,无事可做,入夜更甚,加之天热,夜半未眠.开机入centos,查前日所装MariaDB,root竟无密码,顷password之.然细查之下,user表中root名目竟有五条之多,遂只留一host为%,余皆删之.后觉不当,以host=localhost补之.时觉甚爽,不知大祸至矣.

待出,复入MariaDB,Mysql库竟隐匿不见.Google查察之下,竟是本机登录所致,原user表以root为神器,余皆臣之.host为localhost时,失其权,故Mysql不现.

本欲废之立新,然Google禀有尝此法者,不能解.度娘回 Mysql 以skip-grant-tables 之法 或能解.试之,败.MariaDB虽与MySQL同枝一脉,却并非全然相同,亦不能解.

思之良久,遂以-h 127.0.0.1试之,虽败却收获颇丰.以此法度之,本机之址,以127.0.0.1,localhost为绳.想那centos以何址为绳,改IP,试之.成矣.

立入,复其localhost之执掌之权.退再入,Mysql现矣.此困解矣.

ps:一代宗师叶先生云:念念不忘,必有回响.诚不欺我也.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn