先配置 环境变量 再在根目录加个my.ini文件
mysqld -install
mysqld --initialize-insecure --user=mysql
net start mysql
mysql -u root -p
use mysql;
update user set authentication_string=password('123456') where user='root' and Host='localhost';
flush privileges;
quit
遇到问题:
1.安装Mysql执行初始化没有生成系统数据库文件夹 mysqld --no-defaults --initialize
2.密码空 确认错误, 个人建议看这篇文章 mysql遇到Access denied for user 'root'@'localhost'以及修改密码问题的解决_疯不想的博客-CSDN博客
但他的 update user set authentication_string=password('123456') where user='root' and Host='localhost'; 语句是错误的,用我这条。
3. 十分注意 update user set authentication_string=password('123456') where user='root' and Host='localhost'; 这语句,但凡少了空格,多了空格都会导致错误,但cmd不会报错,只会有英文语句提示 0 effect,非常不引入注意!!!! 成功是 1 effect