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

Example Analysis of installation-free installation of MySql 5.7.17 package

2025-03-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article is to share with you the content of the sample analysis of the installation-free package of MySql 5.7.17. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

There are two versions of MySQL database management software, one is the enterprise version and the other is the community version, in which the former is charged, and if it is for personal use, the community version is sufficient. After downloading mysql-5.7.17-winx64.zip and unzipping it to the directory of your choice, as shown in figure 1, you will see the configuration file my-default.ini in the folder. At this point, you need to copy and paste it into the bin folder and rename it to my.ini, as shown in figure 2. At this point, the preparatory work is complete, and the specific configuration process will be described in detail below.

Tools / raw materials

(1) computer: Lenovo B460e

(2) operating system: windows 7pl 64 bit

(3) mysql-5.7.17-winx64.zip.

Methods / steps

(1) configure system environment variables; 1. Add a new system environment variable MYSQL_HOME with a value of:

[C:\ Program Files\ MySQL\ mysql-5.7.17-winx64]

2. Edit the system environment variable path and add the following code (including the colon ";"): [% MYSQL_HOME%\ bin;].

(2) the my-default.ini in the root directory remains unchanged. Configure the my.ini in the bin folder and change the contents of the my.ini file to the following:

My.ini:

# For advice on how to change settings please see# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html# * * DO NOT EDIT THIS FILE. It's a template which will be copied to the# * * default location during install, and will be replaced if you# * * upgrade to a newer version of MySQL [cilent] port=3306default_character_set=utf-8 [mysqld] # 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 =% MYSQL_HOME%datadir =% MYSQL_HOME%dataport = 3306server_id = 10default_character_set = utf-8max_connections = 20 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 = 512Msort_buffer_size = 8Mread_rnd_buffer_size = 8m sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

Some understanding of my.ini configuration files:

1.innodb_buffer_pool_size: it is recommended to set it to 50% of the operating system memory. If the setting is too large, MySQL may take up system swap space, causing the system to slow down, thus reducing query efficiency

2.basedir: this is the environment variable you set earlier.

3.server_id: with regard to master-slave replication, it should be set casually, but it must be unique.

4.datadir: subsequent initialization and other data will be saved in this file, and subsequent operations of the file will be automatically established.

5.port: the port number to connect to the database is 3306. The default for online installation of MySQL is 3306.

6. The last three parameters are also roughly the size of each buffer, which is not well understood, but each is multiplied by 4 on the default value (the computer with good performance can be higher).

(3) initialize the database and configure the relevant information to run the command line prompt as an administrator (be sure to run as an administrator, otherwise you will not have permission to configure mysql).

1. Enter the command "mysqld install MySQL" and press enter, as shown in the following figure, to indicate that MySQL is installed successfully.

two。 Entering the command "mysqld-initialize-insecure" and pressing enter will automatically generate root users without passwords, while executing the command "mysqld-initialize" will automatically generate root users with random passwords (note, two -), and root users' passwords will be set later. Root (named after Linux) is a user with super administrative privileges in MySQL.

Note: after successful execution of this process, the system will generate a data folder in the MySQL root directory.

3. Enter the command "net start mysql" and press enter to start the MySQL server

(4) set the password of the root user to run the command prompt as an administrator (be sure to run it as an administrator, otherwise you will not have permission to configure mysql).

1. Check whether the MySQL server is started. If so, enter the command "net stop mysql" and press enter to stop the MySQL server.

two。 Enter the command "mysqld-skip-grant-tables" and press enter. Note that this command does not start the MySQL server. At the very least, you can see that the status of the MySQL server is stopped in the task manager.

3. Open a command line window as a normal user (such as typing cmd directly in the running window to open it)

4. Enter the command "mysql-u root-p" and press enter, and then you will be prompted to enter the password. At this time, you do not need to enter the password and press enter directly.

5. After entering the database, execute the following command in turn:

1) Select database: "use mysql;"

2) set the new password of user root to "123456":

"update user set authentication_string=password ('123456') where user='root';"

3) reload the permission table, even if the execution of the above command takes effect: "flush privileges;"

4) exit MySQL: "exit;".

6. Open the task manager, click the process tab, and select and end the process mysqld.exe (note: it's the process, not the service).

7. Log in to MySQL with user / password: root/123456. As shown in the figure below, MySQL login is successful. At this point, the password setting for the root user ends.

Note (1) my.ini is placed in the bin directory, not in the root directory with my-default.ini (when I put it in the root directory as other netizens do, the initialization data file will report that the folder cannot be found)

(2) some tutorials say that you need to create an empty data folder here, but you don't have to. According to the official document, the data folder will be created automatically in one of the next steps.

(3) when setting the parameters in the my.ini file, delete the # character before the parameters you set.

(4) you can start and stop the MySQL server and configure MySQL only if you open a command prompt window as an administrator.

(5) the function of the command "mysqld-skip-grant-tables" is to skip the permission security check, which will result in no access control for any user, including root users, so that you can log in to MySQL and change the password of root users without entering a password.

(6) the command "mysqld-skip-grant-tables" will cause any user to access without access control, that is, you can log in to MySQL without entering a password, and in order to enable access control, you can open it by using the command "mysqladmin flush-privileges" or "mysqladmin reload". Or after any user logs in to MySQL without a password, enter the command "flush privileges" and execute it, so that access control can be turned on.

Thank you for reading! This is the end of this article on "sample analysis of MySql 5.7.17 package installation-free installation". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!

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