Mysql Install Windows

Installation: noinstall ZIP Archives (no installation interface, manual installation)

A. Download

https://dev.mysql.com/downloads/mysql/5.7.html#downloads

II. To write the configuration file, ready initialization data

  • New my.ini file in the extracted directory of mysql
    F:\mysql-5.7.26-winx64\mysql5.7\my.ini
  • Text editing configuration
    datadir fill out a data file path, the file must be a folder, or does not exist will do (automatically created during initialization)

      [mysql]
      # 设置mysql客户端默认字符集
      default-character-set=utf8
      [mysqld]
      #skip-grant-tables
      # 设置3306端口
      port = 3307
      # 设置mysql的安装目录
      basedir=F:\mysql-5.7.26-winx64\mysql5.7
      # 设置mysql数据库的数据的存放目录
      datadir=F:\mysql-5.7.26-winx64\mysql5.7\data
      # 允许最大连接数
      max_connections=20
      # 服务端使用的字符集默认为8比特编码的latin1字符集
      character-set-server=utf8
      # 创建新表时将使用的默认存储引擎
      default-storage-engine=INNODB

III. Initialization data (and initiate a shutdown mysql)

  • cmd window ( Administrator, open ) cd into the bin directory mysql directory under
  • input the command
    mysqld --defaults-file=my.ini(ini文件路径) --initialize --console
  • The console gives a root of the initial password
    is similar to this prompt: A temporary password is generated for root@localhost:iTag*AfrH5ej
    If you forget, you can find .err suffix in the data directory of the log file to see
  • This password will be asked for root first landing, landing after changing your password
  • change Password:ALTER USER 'root'@'localhost' IDENTIFIED BY 'root-password'
  • Start: mysqld --console
  • Close: mysqladmin -u root -p password -P3307 shutdown (or simply close the cmd window)



Guess you like

Origin www.cnblogs.com/laoyin666/p/11023232.html