windows 安装 mysql


安装

下载 Windows MySql

解压缩进入 MySql 的 bin 目录,以管理员权限打开 CMD:

  • 初始化数据库:
mysqld --initialize --console

这里需要记住初始密码:

  • 安装 MySql 服务
mysqld -install
  • 启动 MySql 服务
net start mysql
  • 登录数据库
mysql -u root -p

使用上面记住的密码登录

  • 修改密码
alter user 'root'@'localhost' identified with mysql_native_password by '6';
  • 退出
quit
  • 关闭服务
service mysql stop 
SQL