mysql安装命令

MySQL8.0.12
–安装
mysqld -install
–获取密码
mysqld –initialize
–启动服务
net start mysql
–日志:(可查看密码等)
DESKTOP-S2IO3JT.err
–登陆:
mysql -u root -p
–设置密码(不生效)
ALTER USER USER() IDENTIFIED BY ‘新密码’;
ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘00’;—————这个语句成功了
更新密码:
update mysql.user set authentication_string=password(‘新密码’) where user=’root’ and Host = ‘localhost’;
update mysql.user set authentication_string=password(‘00’) where user=’root’ and Host = ‘localhost’;
–设置新密码
set password for root@localhost=password(‘xxxxxx’);
set password for ‘root’@’localhost’=password(‘000’);
set password for root@localhost=password(‘00’);—第一次进入数据库可以修改密码使用

flush privileges;不知道有什么鬼作用

你可能感兴趣的:(mysql)