Introduction to the MYSQL folder
The executable file is placed in the bin directory. Docs
stores
documents.
Include
contains header files.
lib
stores library files.
share
stores language and character set related information.
COPYING
stores copyright information
README
open source protocol information
mysql download
[Step 1] MySQL is divided into installation version and decompression version. The decompression version is downloaded here. The download address is
https://downloads.mysql.com/archives/community/Because
the latest version is not stable, so choose 5.7.24 here Version, choose 32-bit or 64-bit according to your computer configuration, here I choose Windows (x86, 64-bit), ZIP Archive click Download
MYSQL environment variable settings
[Step 2]
①Search for the environment variable in the computer input box, then compile the environment variable, and fill in the variable value with the directory decompressed from the installation package just downloaded on your computer ②Set the following content
in Path
to complete the environment variable settings
Configuration file my.ini
[Step 3] Create a configuration file in the directory where mysql is located, create a text file and modify .txt to .ini. Open with notepad, enter
the following code, and save
[mysql]
default-character-set=utf8
[mysqld]
character-set-server=utf8
default-storage-engine=INNODB
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
Initialize MySQL
[Step 4] Run the command prompt as an administrator
① Type in the command line mysqld --initialize-insecure
, press Enter, and wait for a while. If there is no error message (as shown in the figure below), it proves that there is no problem with the initialization of the data directory. At this time, check that the data directory has been generated under the MySQL directory.
mysqld --initialize-insecure
②Knock in the black box mysqld -install
and press Enter.
mysqld -install
③Knock in the black box net start mysql
and press Enter.
net start mysql // 启动mysql服务
net stop mysql // 停止mysql服务
④
Type in the black box mysqladmin -u root password 1234
, here 1234
refers to the password of the default administrator (that is, the root account), you can modify it to your liking.
mysqladmin -u root password 1234
So far, the MySQL 5.7 decompressed version has been installed!
Login to MySQL
Right-click the start menu, select 命令提示符
, open the black box.
Enter in the black box, mysql -uroot -p1234
and press Enter, the following figure appears and the lower left corner is mysql>
, then the login is successful.
mysql -uroot -p1234
Mysql cannot log in after entering the correct password, and ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: yes) appears
But I am correct in every step, and I still make mistakes. ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: yes) I have studied this problem for a long time and know that mysql input is correct after reading this
blog
. The password cannot be logged in, and ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: yes) appears
MySQL uninstall
If you want to uninstall MySQL, it's easy too.
Right-click the start menu, select 命令提示符(管理员)
, open the black box.
- Type
net stop mysql
and enter.
net stop mysql
- Type again
mysqld -remove mysql
and press Enter.
mysqld -remove mysql
- Finally, delete the MySQL directory and related environment variables.
At this point, MySQL uninstallation is complete!