Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install configuration for mysql 8.0.15

2025-01-18 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.15 how to install the configuration, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

1. Environment

System: windows 64 bit

Mysql version: mysql 8.0.15

two。 Download the article

First, download the database installation file, go to the mysql official website to download the channel https://www.mysql.com/downloads/, and click Community → MySQL Community Server, as shown below:

After entering the download page, select the operating system. Here we select the default Microsoft Windows system, and find the version suitable for our system below. I choose 64-bit download here, and click Download to start the download, as shown below:

What is downloaded here is the ZIP package, which can be downloaded locally and then decompressed directly to the corresponding directory.

3. Installation section

Ps: after unzipping the downloaded ZIP package to the appropriate directory, open the installation directory. There should be no data folder and my.ini files in the directory.

3.1 configure environment variables

Need to configure the environment variable before installation, right-click "my computer → properties → advanced system settings → advanced → environment variable → system variable, find path variable double-click, or click Edit, pop-up edit system variable, add the Mysql installation path to the variable value, the path is accurate to the installation directory under the bin directory.

Ps: note that it is added after the original value, not overwritten, otherwise unexpected results may occur.

3.2 add Profil

Create a new document in the extracted mysql directory, and copy the following code to paste it after opening it:

[mysqld] # set port 3306 port=3306# set mysql installation directory basedir=D:\\ Program Files\\ mysql-8.0.15-winx64# set the data storage directory of the mysql database # datadir=# the maximum number of connections max_connections=200# allows the number of connection failures. The character set used by the max_connect_errors=10# server defaults to the default storage engine default-storage-engine=INNODB# that UTF8character-set-server=UTF8MB4# will use when creating new tables using the "mysql_native_password" plug-in authentication # mysql_native_passworddefault_authentication_plugin=mysql_native_ password [MySQL] # setting the mysql client default character set default-character-set=UTF8MB4 [client] # setting the default port port=3306default-character-set=UTF8MB4 when the mysql client connects to the server

Modify the value of basedir, set it to mysql in the installation directory, the above is my installation directory, each set up according to their own actual directory.

Ps: notice here that my file directory is connected with a double slash, and there are also single slashes on the Internet.

When the settings are complete, click Save, save the file name as my.ini, and the file configuration is complete!

3.3 initialize the database

Run cmd as an administrator and send it to the west. By default, cmd is located in a directory of C disk. Here, you need to return to the root directory of C disk, and then go to the bin directory of mysql. The operation is as follows:

The DOS commands you need are as follows:

Cd\ return to the root directory

D: enter D disk

Cd\ enter the specified directory

After entering the mysql directory, enter mysqld-- initialize-- console to initialize the database. The correct return should be the following information. Note that the string after root@localhost needs to be written down and used later.

OK, you look quite smooth here, but it took me a lot of work to install. Now I would like to share with you some problems in the process of installation:

1. During initialization, I typed mysql-- initialize-- console, and the result was error:unknown option-- initialize. Did you see the problem? a very low-level error. I wrote mysqld as mysql. Xiaobai was very depressed. Isn't it MySQL? when did you add a small d? but that's what people are like. Just remember.

two。 Question direct mapping

Xiaobai I look confused, there is a waring, two error, OK, one by one

Warning: read it in my half-baked English, feel it in the code, let me use UTF8MB4, remember that there is a code in the configuration file, then I will change it. Here, please turn it up to 3.2, change all the UTF8 places in the my.ini file to UTF8MB4, save and reinitialize.

Error: as if there is a file already exists, sounds as if it should not exist, let it be thrown away, the second error directly write and throw away, well, directly Baidu, the original mysql installation directory automatically generated a data directory (note, download decompressed the original file is not this file), then directly delete the data directory and then rerun the initialization statement, complete!

3.4 installation Services

Next, install the service using mysqld-- install [Service name]. Here the service can be left unwritten, and the default is mysql. If multiple services are installed on the computer, you can distinguish them by different names. The successful installation prompt is shown below:

If the service is already installed, you will be prompted the service already exists!.

Start the service

Start the MySQL service net start mysql with the command.

Stop the service by commanding net stop mysql.

Uninstall the MySQL service by sc delete MySQL/mysqld-remove command

OK, it's over!

Thank you for reading this article carefully. I hope the article "how to install and configure mysql 8.0.15" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report