The following MySQL 5.7.27 Detailed Download, Installation and Configuration Tutorials
[A long time ago also recorded a MySQL8.0 installation and configuration process, if 8.0 can refer to another article below]
I. Preface
Recently had a few years ago, the project uses MySQL5.7, and MySQL8.0 is not quite the same, found this existing blog, the record is quite detailed, the experiments installed several times, the scene is almost exactly the same, very practical, reproduced for the record, easy to follow the use of view.
[Original author’s message: in the installation of MySQL will encounter a lot of problems, the blog has a lot of solutions to the problem, here I attach some links, encountered problems friends can read the reference Ha ~]
II. Download Steps
Visit the official website:https://www.mysql.com/
Slide to the bottom of the home page and select MySQL Community server under Downloads.
Slide to the bottom of the home page and select MySQL Community server under Downloads.
Click to view the download history version
According to the version of your computer to download the corresponding ZIP file, my computer is 64-bit, so choose this to download, click Download will enter the following interface:
Manually selectable history version
Click [No thanks,just start my download] Download directly without logging in, wait a while for a download pop-up window.
Just click on [Save] and start the download
Once downloaded extract the files to the disk and directory you want to save them to. I extracted the files to the E:\Program Files\Mysql directory.
The above completes the download in its entirety.
II. Configuring Environment Variables
1, right-click this computer -> Properties -> Advanced System Settings -> Environment Variables -> System Variables
Click New, the variable is named:MYSQL_HOME,increaseLocation of your mysql-5.7.27-winx64 folder。
Mine is inE:\Program Files\Mysql\mysql-5.7.27-winx64, as shown:
2、Edit Path
make a copy of%MYSQL_HOME%\binto the back of the original value, as shown:
3. Configure the my.ini file.
In your mysql-5.7.27-winx64 directoryCreate a new my.ini fileMine is in theE:\Program Files\Mysql\mysql-5.7.27-winx64 directoryNew construction.
The contents of the my.ini file are: If the installation directory is different, remember to change the MySQL installation path.
[mysqld]
# port number
port = 3306
Path to #mysql-5.7.27-winx64
basedir=E:\Program Files\Mysql\mysql-5.7.27-winx64
Path to #mysql-5.7.27-winx64+\data
datadir=E:\Program Files\Mysql\mysql-5.7.27-winx64\data
# Maximum number of connections
max_connections=200
# encoding
character-set-server=utf8
default-storage-engine=INNODB
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysql]
# encoding
default-character-set=utf8
Once created go to the next step.
4. Install MySQL
(1) In the input box, entercmdin order toRun as an administratorWatch this space.Always, always, always run as an administrator.line, otherwise the installation process will be caused by insufficient administrative privileges to theInstall/Remove of the Service Denied!This is very important!
(2) IncmdInto theE:\Program Files\Mysql\mysql-5.7.27-winx64\binCatalog.
Enter the install command:mysqld -installIf there is aService successfully installed, proving that the installation was successful; if theInstall of the Service Denied, then it means that cmd is not being run with administrator privileges:
Then continue entering commands:mysqld –initialize, there will be no prompting at this point:
Enter the startup command again:net start mysqlThe following message appearsProof of successful MySQL startup:
5. Setting MySQL Password
(1) Setting a password here is mainly a solution:ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: NO)exclusionary rule
(2) First stop MySQL service, enter the command line net stop mysql:
(3) InFind my.ini in the E:\Program Files\Mysql\mysql-5.7.27-winx64 directory., add the following line under the [mysqld] fieldskip-grant-tablesYou can save it:If the installation directory is different, remember to change the MySQL installation path.
(4) Restart MySQL and enter the startup command:net start mysqlThe following message appears to prove that MySQL has started successfully:
After entering the commandmysql -u root -pYou don’t need to enter a password, just enter:
Entering MySQL was successful! Haha, it should be worth being happy after coming to this step!
(5) Entering the command lineuse mysql, into the database:
(6) Enter command lineupdate user set authentication_string=password(“xxxxxx”) where user=”root”;
xxxxxx is the new password you set, if the following message appears after you hit enter, it proves that the modification is successful!Don’t forget the semicolon at the end.
(7) Manually stop the MySQL service by typing in the win10 search barserviceFindMySQL. Just right click and then click Stop.
Then in the my.ini file you just deleted theskip-grant-tablesThis line, save close.
(8) Re-startcmd(as administrator), enter the startup command:net start mysqlThen entermysql -u root -pWhen you enter the password you just set, the following message appears to prove that the setting is successful!
Then enter the command lineuse mysqlVerify it and it reports an error:
Since you haven’t reset your password, just do it
Type the command linealter user user() identified by “xxxxxx”;
My password is 123456, so I type inalter user user() identified by “123456”;Back to the car! Getting closer to victory!
Enter the command line againuse mysqlVerify that it worked!
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — the following no body — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — ————————-
Note:For learning purposes only, to record questions and references, and for mutual encouragement!
Refer to the documentation:
1、mysql5.7 above configuration my.ini_baidu_41909653’s blog – blog_mysql5.7my.ini
4、ERROR 1054 (42S22): Unknown column ‘password’ in ‘field list’_Swordsman365’s Blog-Blog
5、【mysql】You must reset your password using ALTER USER statement before executing this statement._Joker_Ye’s blog – Blog
Link to original article:MySQL 5.7.27 Detailed Download and Installation Configuration Tutorial_ZZZZhonngger’s Blog – Blog_mysql Installation Tutorial 5.7