赞
踩
Linux 系统安装的MySQL8 重置初始化操作:
/usr/local/mysql
rm -rf data/*
rm -rf logs/*
systemctl start mysqld
mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2022-04-27 22:03:16 CST; 2s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 6105 ExecStart=/usr/local/mysql/bin/mysqld --defaults-file=/usr/local/mysql/conf/my.cnf (code=exited, status=1/FAILURE)
Main PID: 6105 (code=exited, status=1/FAILURE)
./bin/mysqld -remove MySQL
./bin/mysqld \
--defaults-file=/usr/local/mysql/conf/my.cnf \
--basedir=/usr/local/mysql/ \
--datadir=/usr/local/mysql/data/ \
--user=mysql \
--initialize
systemctl start mysqld
systemctl status mysqld
mysql -uroot -p'3)Mqpkp&u!.0'
use mysql;
alter user 'root'@'localhost' identified by 'root';
update user set host='%' where user='root';
flush privileges;
问题处理结束,MySQL正常使用
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。