In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Prepare:
Download address of MySQL8.0 Windows zip package: https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.11-winx64.zip
Environment: Windows 10
I. installation
1. Extract the zip package to the installation directory
My installation directory is D:\ Program Files\ mysql-8.0.11-winx64
two。 Configuration file
By default, the configuration file in the windows system is the my.ini file under the installation directory. Some of the configuration needs to be configured during the initial installation, and most of it can be changed after the installation is completed. I don't know what happened to others. Mine is that the my.ini file does not exist in the file directory, so I created the new file as follows
Write the basic configuration as follows:
[mysqld] default_authentication_plugin=mysql_native_password# Remove leading # and set to the amount of RAM for the most important data# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. # innodb_buffer_pool_size = 128M# Remove leading # to turn on a very important data integrity option: logging# changes to the binary log between backups.# log_bin# These are commonly set, remove the # and set as required.basedir=D:\ Program Files\ mysql-8.0.11-winx64datadir=D:\ Program Files\ mysql-8.0.11-winx64\ data (these two lines are the main changes, and the data folder is automatically generated Others can be pasted directly) port = 330 server_id =. # Remove leading # to set options mainly useful for reporting servers.# The server defaults are faster for transactions and fast SELECTs.# Adjust sizes as needed, experiment to find the optimal values.# join_buffer_size = 128M# sort_buffer_size = 2M# read_rnd_buffer_size = 2m sql_mode=NO_ENGINE_SUBSTITUTION STRICT_TRANS_TABLES character-set-server = utf8mb4performance_schema_max_table_instances = 600table_definition_cache = 400table_open_cache = 256 [mysql] default-character-set = utf8mb4 [client] default-character-set = utf8mb4
Note that basedir is my local installation directory, datadir is the location where my database data files are stored, and each configuration needs to be configured according to my own environment.
3. Initialize the database
Execute the command in the bin directory of the MySQL installation directory:
Mysqld-initialize-console
When the execution is complete, the initial default password for the root user is printed, such as:
2018-05-01T14:35:01.507037Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE',' NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.2018-05-01T14:35:01.507640Z 0 [System] [MY-013169] [Server] D:\ Program\ MySQL8\ bin\ mysqld.exe (mysqld 8.0.11) initializing of server in progress as process 110642018-05-01T14:35:01.508173Z 0 [ERROR] [MY-010340] [Server] Error message file'D:\ Program Files\ mysql-8.0.11-winx64\ share\ english\ errmsg.sys' had only 1090 error messages But it should contain at least 4512 error messages. Check that the above file is the right version for this programmers 2018-05-01T14:35:05.464644Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: APWCY5ws&hjQ2018-05-01T14:35:07.017280Z 0 [System] [MY-013170] [Server] D:\ Program\ MySQL8\ bin\ mysqld.exe (mysqld 8.0.11) initializing of server has completed
Among them, the "APWCY5ws&hjQ" in line 4 is the initial password, which needs to be remembered before changing the password, which is needed for subsequent logins.
If you are cheap, close fast, or don't remember, that's fine. Delete the initialized datadir directory, execute the initialization command again, and it will be regenerated. Of course, you can also use security tools to force you to change your password, and you can do whatever you want.
4. Installation service
Execute the command in the bin directory of the MySQL installation directory:
Mysqld-- install [service name]
The following service name can be left unwritten, and the default name is mysql. Of course, if you need to install multiple MySQL services on your computer, you can distinguish them with different names, such as mysql5 and mysql8.
After the installation is complete, you can start the MySQL service with the command net start mysql.
two。 Change password and password authentication plug-in
Execute the command in the bin directory of the MySQL installation directory:
Mysql-uroot-p
At this time, you will be prompted to enter the password, remember the password in step 3, enter it to log in successfully, and enter the MySQL command mode
Before MySQL8.0.4, execute
SET PASSWORD=PASSWORD ('[modified password]')
You can change the password, but starting with MySQL8.0.4, it doesn't work by default. Because before, the password authentication plug-in for MySQL was "mysql_native_password", but now it is "caching_sha2_password".
Because there are many database tools and link packages that do not support "caching_sha2_password", for convenience, I temporarily changed back to the "mysql_native_password" authentication plug-in.
Execute the command in MySQL:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY' password'; (be sure to have a semicolon) (pay attention to a semicolon)
Modify the password authentication plug-in and change the password at the same time.
If you want to use "mysql_native_password" plug-in authentication by default, you can configure the default_authentication_plugin entry in the configuration file.
[mysqld] default_authentication_plugin=mysql_native_password
Let's take a look at installing mysql8.0.11 under win10.
1. Unpack the download software under D:\ mysql.
2. Create my.ini under D:\ mysql, and add basedir, datadir, port and other settings.
3. Add D:\ mysql\ bin to the system environment variable
4. Run cmd as an administrator and initialize the database: mysql-- initialize-- console. Remember the initialization root password.
5. Install the database service: mysqld-- install service name (default is mysql)
6. Start the database: net start service name
7. Log in: mysql-u root-p, and enter the initialization password
8. Modify the root password: alter user 'root'@'localhost' identified by' xxxxx'
For more information, please refer to: https://dev.mysql.com/doc/refman/8.0/en
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.