Author:pingfan_yu
Data:2021.12.3
报错内容:
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we’ll need the current
password for the root user. If you’ve just installed MariaDB, and
you haven’t set the root password yet, the password will be blank,
so you should just press enter here.
**解决方法:
先 "crtl+C"退出然后****运行 “mysql -u root -p” ,
设置自己的密码:
set password for ‘root’@‘localhost’=password(‘密码’);
授权然后退出
** grant all privileges on . to root@’%’ identified by ‘密码’;
grant all privileges on . to root@‘localhost’ identified by ‘密码’;
grant all privileges on . to root@‘主机名’ identified by ‘密码’;
然后在运行:mysql -h 自己ip -u root -p
这样错误就能解决了