(Because the installation of mysql8 is slightly different from the previous version, this article is modified on the basis of the previous article " Win7 installs MySQL 64-bit decompressed version ")
The Windows version of MySQL is divided into two types: the ims installation version and the zip compressed version. Among them, the installation version can be directly run and installed, while the compressed version is more complicated, and needs to be configured after decompression.
1. Download the latest version of MySQL
Download the latest 64-bit Windows compressed version from MySQL's official website, the download link is mysql-8.0.21-win64.zip
2. Unzip
Unzip a directory, the path after I unzip is D:\database\mysql\mysql-8.0.21-winx64
3. Configure system environment variables
On the Win10 desktop, right-click Properties, on the left side of the pop-up System Basic Information dialog box, click Advanced System Settings, click the "Environment Variables (N)..." button at the bottom right, and in System Variables, modify the value of the Path variable (If there is no Path variable, create a new one), add the bin path of mysql (to go to the bin directory), if Path already has other variable values, enter it at the end; (English semicolon), add the bin directory of mysql
Path D:\database\mysql\mysql-8.0.21-winx64\bin
4. Modify the configuration file
In the mysql decompression directory D:\database\mysql\mysql-8.0.21-winx64, add the my.ini configuration file, specify the installation path and data path basedir, datadir, the configuration file is as follows
[mysqld]
basedir = D:\database\mysql\mysql-8.0.21-winx64
datadir = D:\database\mysql\mysql_data
port = 3306
server_id = 1
5. Initialize the database
Enter the CMD of the system as an administrator, or click Windows PowerShel (admin) in the pop-up menu with win+x, switch the path to the mysql decompression directory
cd /d D:\database\mysql\mysql-8.0.21-winx64\bin
Execute the command to initialize
mysqld --initialize --console
After execution, a root login password will be generated at the end. Write this down and use it later when you log in to root for the first time.
6. Installation service
Execute mysqld -install in the bin directory to install and create a windows service
D:\database\mysql\mysql-8.0.21-winx64\bin>mysqld -install
Service successfully installed.
Open the Windows "Services" management interface, you can see the MySQL service, start it
You can also execute the following command to start the mysql service
net start mysql
7. Enter mysql and modify the root password
Use the password you just initialized to enter, and then modify the root default password
D:\database\mysql\mysql-8.0.21-winx64\bin>mysql -u root -p
Enter password: ************
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.18
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
After mysql version 8.0, the password function setting of MySQL has been cancelled, so the method of setting password to modify the password is not feasible. Use the alter user command to directly change the root password, and the following prompt will always appear:
mysql> ALTER USER "root"@"%" IDENTIFIED BY "yourpassword";
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
Obviously using alter user to reset the password, but always reminding to use the alter user to reset the password, confused. After investigation, it is necessary to execute the following password reset statement first
alter user user() identified by 'yourpassword';
Then change the root password again.
ALTER USER "root"@"%" IDENTIFIED BY "yourpassword";
8. You're done
Now that the installation is complete, you can build databases, build users, and play mysql happily.
It should be noted that the way mysql8 creates users and authorization is also different from before. The script is as follows:
mysql> create database mydb;
Query OK, 1 row affected (0.00 sec)
mysql> CREATE USER 'myname'@'%' IDENTIFIED BY 'yourpassword';
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON mydb.* TO 'myname'@'%' WITH GRANT OPTION;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mydb |
| mysql |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.00 sec)
mysql>
If Chinese garbled characters appear when importing the sql file, first use status to check the encoding, and then use utf8 to log in
mysql -u yourname -p --default-character-set=utf8mb4
After logging in, use source to import the sql file in mysql.
Welcome to follow my WeChat public account "Big Data and Artificial Intelligence Lab" (BigdataAILab) for more information
Recommended related reading
1. AI combat series
- [AI combat] Teach you text recognition by hand (text recognition: LSTM+CTC, CRNN, chineseocr method)
- [AI combat] Teach you text recognition by hand (Text Detection Part 1: MSER, CTPN, SegLink, EAST, etc.)
- [AI combat] Teach you text recognition by hand (text detection part 2: AdvancedEAST, PixelLink method)
- [AI combat] Teach you text recognition by hand (Introduction: Verification Code Recognition)
- [AI combat] Quickly master TensorFlow (1): basic operations
- [AI combat] Quickly master TensorFlow (2): Computational graph, conversation
- [AI combat] Quickly master TensorFlow (3): Incentive function
- [AI combat] Quickly master TensorFlow (4): loss function
- 【AI combat】Build a basic environment
- [AI combat] Training the first model
- 【AI combat】Write a face recognition program
- [AI combat] hands-on training target detection model (SSD)
- [AI combat] hands-on training target detection model (YOLO)
2. Dahua Deep Learning Series
- [Essential finishing] CNN evolution history
- Classical Model of Big Word Text Recognition (CRNN )
- Classical Model of Big Word Text Detection (CTPN)
- Classical model of big talk text detection (SegLink)
- Classical Model for Big Speech Text Detection (EAST)
- Classical model of big talk text detection (PixelLink)
- Classical model of big talk text detection (Pixel-Anchor)
- Dahua Convolutional Neural Network (CNN)
- Dahua Recurrent Neural Network (RNN)
- Dahua Deep Residual Network (DRN)
- Dahua Deep Belief Network (DBN)
- Big talk CNN classic model: LeNet
- Big talk CNN classic model: AlexNet
- Big talk CNN classic model: VGGNet
- Big talk CNN classic model: GoogLeNet
- The classic model of big talk target detection: RCNN, Fast RCNN, Faster RCNN
- Classic model of big talk target detection: Mask R-CNN
- big talk attention mechanism
3. Graphical AI series
- What is semantic segmentation, instance segmentation, panoramic segmentation
- Various deep learning convolutions (standard convolution, deconvolution, separable convolution, grouped convolution…)
4. AI talk
- 27 classic deep learning models
- A brief introduction to "transfer learning"
- What is "Reinforcement Learning"
- Analysis of the Principle of AlphaGo Algorithm
- How many Vs are there in big data?
5. Big data super detailed series
- Apache Hadoop 2.8 fully distributed cluster building super detailed tutorial
- Apache Hive 2.1.1 installation and configuration super detailed tutorial
- Apache HBase 1.2.6 fully distributed cluster building super detailed tutorial
- Offline installation of Cloudera Manager 5 and CDH5 (latest version 5.13.0) super detailed tutorial