In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
It took three hours to install mysql in person, and with so many tutorials, I still wasted too much time on the road where I shouldn't have spent my time. I hope this article can help you avoid detours.
1. download
Https://www.mysql.com/ official website address
I downloaded 64-bit.
two。 Decompression
After downloading, I chose to extract it directly to disk D, and the file address is D:\ mysql-5.7.23-winx64. It is so clear here that it is for the following environment configuration. You can also choose the corresponding position according to your personal preference.
3. Environment configuration
The environment is configured for later installation using cmd administrator commands.
First, use the control panel, open the system, and find the advanced system settings-- > environment variables
There are two ways to configure the environment:
Method 1: create a new name in the system variable named MYSQL_HOME (you can also do as you like, but if it is a letter), and the value of the variable is written in the corresponding mysql position. Here I write D:\ mysql-5.7.23-winx64.
Next, edit in path, create,% MYSQL_HOME%\ bin, corresponding to the bin directory in the mysql file.
Method 2: create a new file directly in the system variable path edit, D:\ mysql-5.7.23-winx64\ bin, that is, the address of the bin directory file in the mysql file.
Note: the key points are determined after each edit of the environment variable, otherwise it will not succeed.
4. Create a new my.ini file, version 5.7 does not have the file need to create your own, the content is as follows, pay attention to modify your own file address and version information.
[mysqld] port = 3306basedir=D:/mysql-5.7.23-winx64datadir=D:/mysql-5.7.23-winx64/data max_connections=200character-set-server=utf8default-storage-engine=INNODBsql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_ tables [MySQL] default-character-set=utf8
After these configurations are finished, you can start to install. I just messed up for a long time in the following process. It hurts when I think about it. I feel sorry for my detours if I don't write it out. I also hope it can help you save time.
5. Installation
First, cmd, run as an administrator, enter the address of the bin directory file: d:\ mysql-5.7.23-winx64\ bin, and you will find that it always prompts:
Obviously it has been configured, ah, you will find that all kinds of tutorials online, it is said that when setting environment variables, the file address is preceded by ";" or a period and after the semicolon, in fact, the windows10 system does not need these, how to add will be this prompt. The ultimate solution is:
C:\ WINDOWS\ system32 > cd / d D:\ mysql-5.7.23-winx64\ bin
I'm not surprised, surprised or surprised, I'm going to vomit blood. Just add cd / d in front of the file address.
The next step is:
D:\ mysql-5.7.23-winx64\ bin > mysqld-installService successfully installed.
Start the configuration after the installation is successful. Execute the following code and you will find that there is a data folder in the mysql folder.
D:\ mysql-5.7.23-winx64\ bin > mysqld-- initialize-insecure-- user=mysql
After that
D:\ mysql-5.7.23-winx64\ bin > net start mysqlMySQL service is starting. MySQL service has been started successfully.
All right, you can start using it. Happily open the way to train your SQL ability ~ O (∩ _ ∩) O
D:\ mysql-5.7.23-winx64\ bin > net start mysql
Enter mysql-u root-p and you will be prompted to enter Enterpasswords:, to reset the password at this time.
Procedure:
1. Edit the configuration file of MySql: my.ini (in the MySql installation directory).
Open the configuration file, add: skip-grant-tables after the first line of the last line of the file, and then save exit.
It means that grant-tables is not started when mysql is started.
2. Restart the MySql service: close net stop mysql first, and then start net start mysql
3. Set a new root password.
Mysql-u root-p enter directly and enter the database without entering a password.
Execute use mysql at the command line (switch to the system database)
Execute the following statement to change the root user password:
Update user set authentication_string=PASSWORD ("123456") where user='root'
The password set at this time is: 123456
4. Note: restore the configuration file, that is, delete the line of code you just added in my.ini.
Close the cmd interface window and reopen it. Start the mysql service, net start mysql
Enter account name and password 123456
C:\ WINDOWS\ system32 > mysql-u root-pEnter password: *
The results show that:
Welcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 3Server version: 5.7.23 MySQL Community Server (GPL) Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.
You can open the way to run the database.
Summary
The above is the installation tutorial and configuration method of the mysql5.7.23 version introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply you in time. Thank you very much for your support to the website!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.