In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces mysql 8.0.12 installation configuration example analysis, the article is very detailed, has a certain reference value, interested friends must read!
I. Download
After selecting the system platform, click download(64 or 32 bits depending on the system)
II. Configuration
1. After downloading successfully, extract the installation package to the location where you want to install it. I installed it in "D:\MySql\"
If the installation directory contains the data folder, delete
2. Add bin directory to PATH environment variable
III. Installation
1. Run cmd as administrator
2. Enter the bin folder under the installation directory
3. Execute mysqld --initialize or mysqld --initialize-insecure --user=mysql
Successful execution. The data folder will be generated under the installation directory. Open the folder and find the.err file. The text editor has been opened.
Search for "root," followed by a randomly generated temporary password.
4. Continue by typing mysqld --install
5. To detect installation, enter mysql --version
Start mysql service, enter net start mysql, ps: stop service is net stop mysql
IV. Client testing
1. mysql -uroot -p as shown below
User name and password:
1. Create mysql-init.txt in the installation directory, enter ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';, and save.
PS:5.7.5 and earlier Enter SET PASSWORD FOR 'root'@'localhost' = PASSWORD ('MyNewPass ');
2. Close the mysql service, and then enter the bin directory in cmd, enter mysqld --init-file=D:\MySql\mysql-8.0.12-winx64\mysql-init.txt, after the execution is completed, delete the mysql-init.txt file, restart the mysql service.
3. Enter mysql -u root -p, and then enter the password to log in (if you cannot log in, enter the random password in.err to enter mysql, and execute step 4).
4. After entering the mysql shell, retype the previous command in mysql-init.txt
Enter exit and log in again with a new password
5. Verify the normal use of mysql
Enter show databases;
Enter use mysql;
Enter SELECT User,Host,authentication_string FROM user;
VI. Configuration code is UTF-8
1. View default encoding
show variables like '%character%';
2. In the root directory of D:\MySql\mysql-8.0.12-winx64, create a new my.ini file,(this file is missing after 5.7, and you create it yourself), as shown below:
3. Edit my.ini
Under the [mysqld] node, configure the server-side code and add 2 items.
character_set_server=utf8
[mysql] node, this is the configuration client information
We also add [mysql] nodes and configure encoding UTF8
[mysql]default-character-set=utf8[mysqld]default-character-set = utf8character_set_server = utf8[mysql]default-character-set = utf8[mysql.server]default-character-set = utf8[mysqld_safe]default-character-set = utf8[client]default-character-set = utf
As shown below:
VII. Test queries
1. If the configuration file is modified, the service must be restarted first.
2. Log in normally using root user
3. Run the command show variables like "%character%" to view system character set variables, as shown below:
Client connections:
Navicat For MySQL
Error 1251- Client does not support authentication protocol requested by server;consider upgrading MYSQL
Solution:
1. Enter the extracted mysql root directory through the command line.
2, landing database
mysql -uroot -p
3. Enter the root password again:
4. Change the encryption method:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;
Change password: 123456 is the new password in this example
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
6. Refresh:
FLUSH PRIVILEGES;
The final connection was successful:
The above is "mysql 8.0.12 installation configuration example analysis" all the content of this article, thank you for reading! Hope to share the content to help everyone, more relevant knowledge, welcome to pay attention to the industry information channel!
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.