当你忘记mysql密码时,没准你可以这样做
Sometimes you can clobber your configuration. As such, it's easier to start over, as if the package had never been installed. In your case, we are looking at MySQL.
1. use Yum to Remove MySQL, like so:
$ yum remove mysql mysql-server2. removed MySQL, and safely backup the configuration:
$ mv /var/lib/mysql /var/lib/mysql_old_backup3. If you'd rather remove it
$ rm -vR /var/lib/mysql4. Now we can safely reinstall MySQL, using the default configuration that is included in the package from the Official MySQL repository (we need wget to fetch the rpm that will update your repos):
$ yum install wget5. Now download and install the repository:
$ wget http://repo.mysql.com/mysql-c... && rpm -ivh mysql-community-release-el7-5.noarch.rpm6. Verify the repositories are installed:
$ ls -1 /etc/yum.repos.d/mysql-community*7. install command
$ yum install mysql-server8. If you ever need to set the password after using the script, use:
mysql -u root9.Start and Stop the daemon like so:
systemctl start mysqld相关推荐
CoderToy 2020-11-16
emmm00 2020-11-17
王艺强 2020-11-17
ribavnu 2020-11-16
bianruifeng 2020-11-16
wangshuangbao 2020-11-13
苏康申 2020-11-13
vivenwan 2020-11-13
moyekongling 2020-11-13
云中舞步 2020-11-12
要啥自行车一把梭 2020-11-12
aydh 2020-11-12
kuwoyinlehe 2020-11-12
minerk 2020-11-12
vitasfly 2020-11-12
jazywoo在路上 2020-11-11
敏敏张 2020-11-11
世樹 2020-11-11