This is the 8th day of my participation in the August Text Challenge.More challenges in August

Common commands


Note: is the database installed and the environment configured? If not, please look from < 1, Download >

Command statement describe
mysqld –install Installation services
mysqld –initialize –console Initialize. Remember initializeUser name and password
net start mysql Open the service
net stop mysql Close the service
exit exit
mysql -u root -p Log in to mysql, Enter PassWord: // Enter the PassWord
alter user ‘root’@’localhost’ identified by ‘root’; To change the password, by follows the password
sc delete mysql Flag to remove mysql service

Before opening the Workbench, you need to start the mysql service. Suggestion: Perform all operations with the administrator permission, such as CMD and Workbench administrator permission. Note: The following is the window system configuration, if there is any discrepancy, please check it by yourself.

1, download


According to the system to download the corresponding version, the download address: dev.mysql.com/downloads/m…

2, decompress, file and environment variable configuration


  • No need to install, unpack the configuration, createmy.iniAnd the Database (which is a data store file whose content is automatically generated) file, add the following configuration\ needs to be converted to /

  • Copy the following tomy.iniModify the corresponding configuration according to the comments in the file
/ basedir=D://tool/mysql/mysql-8.0.25-winx64 :// mysql/mysql-8.0.25-winx64 Datadir =D://tool/mysql/mysql-8.0.25-winx64/Database # max_connections=200 # Max_connect_errors =10 # The default character set used by the server is UTf8MB4 character-set-server= UTf8MB4 # The default storage engine used when creating new tables is default-storage-engine=INNODB #mysql_native_password default_authentication_plugin=mysql_native_password [mysql] Port =3306 default-character-set= UTf8mb4 [client] # default character set=utf8mb4 [clientCopy the code
  • Configure environment variables

3. Verify the installation and modify the initial random password


Go to the decompression path and run mysqld –install



Initialization:mysqld --initialize --consoleRemember to initializeUser name and password



Start the service:net start mysql

Verify login: mysql -u root -p

Change the database password: alter user ‘root’@’localhost’ IDENTIFIED by ‘root’ // Change the password to root

Exit: exit Re-log in to mysql -u root -p.


If there is any file missing, please install the following arrow pointing to the file, the file in my Baidu cloud disk mysql directoryOr clickHere to download.

4. Configure system global variables


After the preceding steps, you can only operate commands in the pressurized directory, which is not convenient, so configure global environment variables to create mysql variables

Add %mysql%\bin to the system variable path

Direct CMD open, execution may be wrong, I here when the authority problem, through the administrator authority management open, you can solve

Workbench is a graphical management tool for MySql


Download address:Dev.mysql.com/downloads/w…

Administrator Permission Enabled

Installation and use of Redis under Windows

1. To install Redis, first obtain the installation package. The Redis installation package for Windows needs to be openedMaking a link. Find Release and click to go to the download page.


2, In the download page, find redis-x64-xxx. msi and redis-x64-xxx. zip, click download.


Note: MSI is the installation package, zip is the compressed package.

3. Double-click the mSI installation package (Redis-x64-XXx. msi) to start the installation.


4. Select “Agree to the Agreement” and click Next to continue.


5. Select Add Redis directory to environment variable PATH so that the system can automatically identify where the Redis execution file is.


6. Keep the default port number of 6379 and select firewall exception to ensure the normal access to Redis service.


7. Set the maximum value to 100M. For experiment and study, 100 meters is enough.


8. Click Install to start the formal installation process. It will be finished in a moment.


9. After the installation, you need to do some setup work first, so that the service can run normally after starting. Using a text editor, open the Redis service configuration file.Note: don’t get me wrong. It is usually redis.windows-service.conf, not redis.windows.conf. The latter is the configuration file used by the startup program as a non-system service.


10. Add a line where it contains requirepass and type requirepass 12345. This is the password required to access Redis, but it is not required for general testing. However, even for local access, a password is recommended. Simple 12345 is used here.


11. Click Start > Right – click Computer > Choose Manage. In the left column, find and click Computer Management (Local) > Services and Applications > Services. Then find the service with the name Redis on the right and check the startup status. If it is not started, start it manually. Normally, the service should be up and running.


12. Finally, test whether Redis provides services normally.


  • Go to the Redis directory, type Redis -cli and press Enter. (Redis – CLI is the client program.) If the interface is displayed and the port number is correct, the service is started.
  • Password authentication is required before using the service. Type “auth 12345” and press Enter (12345 is the password you set earlier). If OK is displayed, the authentication succeeds.
  • Actually test reading and writing. Enter set mykey1 “XXX” and press Enter to save a key value. Type get myKey1 to retrieve the key value you just saved.

13. Matters needing attention


  • 1.Windows uses a 64-bit version of Redis, so don’t bother with a 32-bit operating system.
  • 2. The Redis configuration file that runs as a service is usually redis.windows-service.conf, not redis.windows.conf. Be careful not to pick the wrong one.

Reference Address:

www.cnblogs.com/winton-nfs/…

www.cnblogs.com/liuqingzhen…