Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

eggjs数据库安装(windows)

安装 数据库 mysql

  • 下载网址

    • https://dev.mysql.com/downloads/mysql/
  • 安装到 D盘 dev目录 下

    • 命令行执行

      cd /d D:/dev/mysql/bin
      
    • 命令行执行

      mysqld --initialize-insecure --user=mysql
      
      • 安装成功后出现data子目录
  • 若显示缺少vcruntime140_1.dll

    • 下载网址为

      • https://cn.dll-files.com/vcruntime140_1.dll.html
    • 下载后解压

      • 把 dll文件 粘贴到C:\Windows\System32
  • 命令行 mysqld --install 开始安装

  • 命令行 net start mysql 启动服务

  • 命令行 mysql -uroot -p 启动数据库

安装 数据库管理软件 Navicat

  • 下载Navicat12 安装包和注册机

  • 在命令行启动数据库后,出现mysql >

    • 然后用以下命令查找端口
      show variables like 'port';
      
  • 用以下命令更改密码为123456

    ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
    
  • 查到端口为 3306

    • 打开软件,文件->新建连接->mysql
    • 连接名设为local,用户默认为root,密码填123456
  • 右击local连接,选择新建数据库,比如book_list,不允许有大写字母

  • 对于mysql8来说,有个sql_mode的问题,会导致group by错误,需要在mysql >后面执行下面语句

    set global sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';```