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)05/31 Report--
This article is about how to use compressed archive files to install MySQL in the Windows system. I think it is very practical, so I share it with you. I hope you can get something after reading this article. Let's take a look at it.
Install MySQL on Windows using compressed documentation installation
1. Extract files to the installation directory
1) Administrator permissions
2) Select the installation location. Default is C:\ mysql, and set the installation location through the configuration file.
3) use the software to extract it. If a home directory is generated by default, please put the subfiles in the home directory on the installation location you specify.
two。 Create a profile
a. Why use profile
1) the installation and data directories are different from the default location
2) you need to customize the server settings
b. File location and name
1) when Windows starts the MySQL service, it looks for configuration files in several places, the Windows directory / MySQL
2) File name my.ini/my.cnf, to avoid conflicts, use one of them
3) make sure that MySQL server users can read my.ini files
c. file format
[mysqld] # set basedir to your installation path basedir=E:/mysql # set datadir to the location of your data directory datadir=E:/mydata/data
d. Initialization of related file location
Initialize MySQL to generate related files
e. Change catalog
Move the original data + the-- datadir command line option for each start of the service
3. Select MySQL server type
1) mysqld: supports named-pipe support
2) mysqld-debug: automatic memory allocation check
Support the same storage engine, use named pipe to turn off named pipe when shutting down
4. Initialize MySQL (initialize with mysqld)
Suppose the% BASEDIR% in your current directory bit configuration file is the MySQL installation directory
a. Initialize the data directory
1) bin\ mysqld-- initialize: contains an expired password, which requires you to choose a new password
2) bin\ mysqld-- initialize-insecure: no root password is generated. Suppose you assign a password before using the service.
3) if MySQL cannot locate the exact installation directory and data storage directory
(1) Command line: bin/mysqld-default-file=C:\ my.ini-initialize
(2) configuration files such as 2.C.
b. The specific behavior sequence when calling the-- initialize/--initialize-insecure option
1) the service checks whether the data directory exists, there is no creation, and an error is reported.
2) in the data storage directory, the server creates mysql system databases and tables
3) initialize the system table, InnoDB table, etc.
4) the server creates a 'root'@'localhost' superuser and other saved users. You should create a key for the superuser
(1) using the-- initialize option, the server generates a random key and marks it as expired, resulting in a warning
(2) use-- initialize-insecure to generate no password
5) if possible, the server generates auxiliary tables and files on the server side
6) if the-- init-file option and the file contains SQL statements, the server executes the statements in the file
7) exit the server
5. Start the MySQL server
MySQL supports named-pipe/TCP/shared memory communication
a. Open the server command:% basedir%\ bin\ mysqld "--console
b. Enable the service:% basedir%\ bin\ mysqld
c. Turn off the service:% basedir%\ bin\ mysqld-u root-p (for password) shutdown
6. Account security settings
When you initialize successfully, start the MySQL service normally, and log in to the database, assign a new password to 'root'@'localhost'
a. Turn on the server, such as 5.
b. Connect to the server:
1) use-- initialize initial session directory: connect to the database as root and log in with the password generated by the server. If you don't know the password, check the error log.
Shell > myslq-u root-p
Enter passworld: (enter the password that has been generated)
2) using-- initialize-insecure:
Shell > mysql-u root-- skip-password
c. After a successful connection, assign a new password to root
Mysql > ALTER USER 'root'@'localhost' IDENTIFIED BY' new_password'
Note:
1) the configuration file is encoded in ANSI.
2) in the above method, two windows need to be opened on the command line, one represents the server process after running the open service command, and then the other window enters the login command to log in to the database.
3) after entering, all the input statements are SQL statements, which need to end with a semicolon. You need to set and change the root password after logging in for the first time.
4) since the individual does not encounter any bug in configuration, if you encounter bug, you can query the official website erro code table on Baidu error code/.
The above is how to use compressed archive files to install MySQL in the Windows system. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow 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.