Mysql 8.0.19 for windows10 installation tutorial (source installation)

Foreword: This tutorial is installed using source code packages. Windows users can also install through the official windows installer .msi program. For problems that may be encountered during the installation process, please refer to the problems that may be encountered during windows installer installation and source code installation.



Article Directory

1.zip installation package download

2. Windows environment configuration

3.ini configuration file modification

4. Initialization and installation

5. Start and change password

6. Some problems you may encounter


1.zip installation package download

  1. Download link: MySQL Community Server 8.0.19

  1. Unzip: After downloading, unzip to the installation directory, for example, 'C: \ Program Files \ mysql-8.0.19-winx64'. You can also change the name of this folder to: 'C: \ Program Files \ mysql' like me.

2. Windows environment configuration

  1. Find the system environment variable settings: "Control Panel-> System and Security-> System-> Advanced System Settings-> Environment Variables-> System Variables"

  2. Add two system environment variables:

    • Variable name: Mysql_Home, Variable value: Your mysql decompression path. For example mine (C: \ Program Files \ mysql)

  • Add mysql bin in Path, such as my directory path "C: \ Program Files \ mysql \ bin"

3.ini configuration file modification

  1. Create a new file in the decompressed root directory of mysql (C: \ Program Files \ mysql): 'my.ini', write the following content, save and exit:

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

    It should be noted that if you and my mysql decompression path are different, you need to modify "basedir", "datadir" these two variables are the value of your own corresponding path.

4. Initialization and installation

  1. Open cmd as an administrator and enter the mysqld --initialize --console command to initialize. A default password will be automatically generated. Copy down the password.

    [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: *********
    

2. Next mysqld --install command line installation.

5. Start and change password

  1. After installation, you can execute the following command to start mysql

    net start mysql
    
  2. Log in to mysql:

    mysql -uroot -p刚才生成的密码
    #比如mysql -uroot -p5CweMmRyLx+a
    
  3. You can use the following command to change the password, the semicolon at the end of the command should be added, NewPassword is the new password to be changed.

    ALTER USER USER() IDENTIFIED BY ‘NewPassword’;
    
  4. Exit mysql:

    quit
    
  5. Close the service:

    net stop mysql
    

6. Some problems you may encounter

1) The code cannot be executed because VCRUNTIME140_1.dll cannot be found. Reinstalling the program may resolve this issue

Solution

2) ERROR 1045 (28000): Access denied for user '-5CweMmRyLx+a'@'localhost' (using password: NO)

If you log in quickly like this: mysql -u root -p may encounter such problems

Please try to log in like this: mysql -uroot -p password

Guess you like

Origin www.cnblogs.com/jaycethanks/p/12697194.html