mysql5.7 decompression installation version-windows10

  1. Right-click to unzip the package, unzip it to the installation directory, the directory name can be defined by yourself
    Insert picture description here

  2. There is no data directory and my.ini in the folder. You need to manually create
    my.ini. First create it as my.txt, and edit it in the next step.
    Insert picture description here

  3. After the creation is complete, right-click my.txt to open the edit text
    basedir is your mysql installation directory
    datadir is your database content storage directory, that is, the
    sql_model created in the second step is used according to the actual development situation. Generally not required
    Insert picture description here
    [mysql]
    # Set mysql client default character set
    default-character-set=utf8
    [mysqld] #Set
    3306 port
    port = 3306 #Set
    mysql installation directory
    basedir=D:\utils\mysql\mysql5.7 #Set
    mysql database data storage Directory
    datadir=D:\utils\mysql\mysql5.7\data #Maximum
    number of allowed connections
    max_connections=200 #The
    character set used by the server defaults to the 8-bit encoding latin1 character set
    character-set-server=utf8 #Create
    a new table The default storage engine that will be used when
    default-storage-engine=INNODB

  4. Save, and then modify the file suffix to ini. Insert picture description here
    If your file does not display the suffix name, you can set it in this position.
    After you check it, you can display it
    Insert picture description here

  5. Configure environment variablesInsert picture description here
    Insert picture description here

  6. Open the cmd command window as an administrator and enter the bin directory under the mysql installation address.
    Execute mysqld --initialize
    successfully. Various files will be generated under the data folder.
    If an error is reported, you need to use the drive letter followed by a double slash.
    basedir=D:\utils\mysql\mysql5.7 is modified to basedir=D:\utils\mysql\mysql5.7
    datadir=D:\utils\mysql\mysql5.7\data is modified to basedir=D:\utils\mysql \mysql5.7\dataInsert picture description here

  7. After executing mysqld --install to generate the windows service
    , it will prompt Service successfully installed.Insert picture description here

  8. At this time, we don’t have an administrator (root) password,
    so we need to configure skip verification in my.ini. Set the password.
    Add skip-grant-tables
    Insert picture description here
    at the bottom of the file . 8. Start the service in cmd and net start mysqlInsert picture description here

  9. mysql -u root -p Press Enter, and press Enter to enter the password
    Insert picture description here

  10. Please use the current version, the following statement to modify the root password, note the single quotes capitalization
    update mysql.user set authentication_string = password ( ' 123456') where user = 'root';
    refresh permission to
    flush privileges;

  11. In the my.ini file, delete the newly added code skip-grant-tables in the last line;

  12. net stop mysql; net start mysql; execute these two commands to restart mysql

If there is a problem with the above modified statement, you can still use it, remember to refresh the permissions flush privileges;
1.alter user'root'@'localhost' identified by '123';

2.set password for ‘root’@‘localhost’=password(‘123’);

Guess you like

Origin blog.csdn.net/qq_35885175/article/details/114132326