【软件安装】MySQL 5.7.26 压缩版安装

梦里梦外; 2023-07-08 05:59 55阅读 0赞

下载

  • MySQL 官网下载

    format_png

安装

  • 解压到需要安装的位置
  • 配置环境变量

    • 配置 MYSQL_HOME

      • 变量名:MYSQL_HOME
      • 变量值:MySQL 的安装目录

        format_png 1

    • 编辑 Path

      • 新增一条变量:%MYSQL_HOME%\bin

        format_png 2

  • 在解压后的目录创建文件 my.ini ,编辑文件

    1. [mysqld]
    2. port = 3306 # 端口号
    3. basedir=C:/DevelopSoft/mysql5.7.26 # MySQL 安装目录
    4. datadir=C:/DevelopSoft/mysql5.7.26/data # MySQL 安装目录下的 data,默认没有该目录,不需要创建
    5. max_connections=6000 # 最大连接时间
    6. character-set-server=utf8 # 编码格式
    7. default-storage-engine=INNODB # 默认引擎
    8. sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
    9. [mysql]
    10. default-character-set=utf8
  • 安装 MySQL,使用管理员身份运行命令行

    1. mysqld -install MySQL

​ 执行成功后提示 Service successfully installed,这时候就可以在进程服务中找到 MySQL 服务了。

  • 初始化 MySQL

    1. mysqld --initialize-insecure (密码为空)
    2. 或者
    3. mysqld initialize(随机生成密码)
  • 运行 MySQL 服务

    1. net start mysql(刚刚创建的服务名)
  • 测试 MySQL 状态

    1. mysql -u root -p
  • 设置 MySQL 密码

    1. SET PASSWORD FOR 'root'@'localhost'=PASSWORD('你的新密码');

验证

  1. C:\Users\Yuu>mysql -uroot -p
  2. Enter password: ******
  3. # 输出
  4. Welcome to the MySQL monitor. Commands end with ; or \g.
  5. Your MySQL connection id is 4
  6. Server version: 5.7.26 MySQL Community Server (GPL)
  7. Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
  8. Oracle is a registered trademark of Oracle Corporation and/or its
  9. affiliates. Other names may be trademarks of their respective
  10. owners.
  11. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

发表评论

表情:
评论列表 (有 0 条评论,55人围观)

还没有评论,来说两句吧...

相关阅读

    相关 mysql压缩安装

    > 前一段时间电脑重装了操作系统,系统中的一些开发环境和开发工具都需要重新配置安装,其中就包括mysql数据库。mysql数据库可以通过安装包进行安装,也可以配置解压缩版进行安