mysql5.7绿色版安装教程

  1. 官网下载mysql5.7绿色版压缩包mysql-5.7.30-winx64.zip

  2. 解压,并配置环境变量,在path环境变量中新增mysql的bin目录,如E:\mysql5.7\bin

  3. 新建my.ini配置文件,内容为

    [mysqld]
    basedir=E:\mysql5.7\
    datadir=E:\mysql5.7\data\
    port=3306
    skip-grant-tables
  1. 管理员方式启动命令行,切换到mysql的bin目录,安装mysqld,输入指令

    C:\windows\system32>cd /d E:\mysql5.7\bin
    E:\mysql5.7\bin>mysqld -install

    显示成功

  1. 初始化数据库文件,生成data目录

    mysqld --initialize-insecure -user=mysql
  1. 启动mysql服务

    net start mysql
  1. 进入mysql,无需密码,直接回车,登录

    mysql -u root -p
  1. 修改密码,刷新并退出,每条指令单独执行,记得加分号

    update mysql.user set authentication_string=password('123456') where user='root'and Host='localhost';
    flush priviledges;
    exit;
  1. 重启mysql服务

    net stop mysql
    net start mysql    
  2. 新密码登录

    mysql -u root -p
    Enter password: ******

猜你喜欢

转载自www.cnblogs.com/come-on-pxw/p/12893815.html
今日推荐