mysql Installation Free Configuration Tutorial

  • 2021-07-06 11:56:22
  • OfStack

In this article, we share the mysql installation-free configuration tutorial for your reference. The specific contents are as follows

1. Download the MySQL installation-free zip package and decompress it to a custom directory, such as: D:\ program0\ mysql (see this directory below)

2. Modify the my. ini file (possibly my-default. ini, manually modified to my. ini);
Items to be configured:


basedir =D:\program0\mysql
datadir =D:\program0\mysql\data

# If you customize this directory, you must move all files in this directory to the new custom directory

port = 3306
server_id =10

3. Configure the default encoding for new data paths:
Also in the my. ini file,
Under [mysqld]
Add character_set_server = gbk

4. Add environment variables

New variable MYSQL_HOME
Input variable name: MYSQL_HOME
Input variable value: D:\ program0\ mysql
2) Add Path

Click the Edit button
To add a variable value to a variable value:
`%MYSQL_HOME%\bin`
Note that this variable is added after the original variable value, using; You cannot delete the original variable value.

5. Register for the mysql service:
1) From the console, go to the bin directory under the MySQL extraction directory (D:\ program0\ mysql\ bin):
2) Enter the service installation command:

mysqld install mysql

# If ` Install/Remove of the Service Denied 'appears, select "Open as administrator" when opening cmd. exe program, and it will be the same when starting service.
# After successful installation, the service will be prompted for successful installation.
# Remove service command is: ` mysqld remove `

6. Start the mysql service: cmd into the console

net start mysql

7. Shutdown mysql service: cmd access console

net stop mysql

8. Configure the root user password:


cmd: mysql -uroot
  mysql< use mysql;
  mysql< delete from user;
  mysql< grant all on *.* to root@'%' identified by "root" with grant option;
  mysql< flush privileges;
  mysql< quit;

Related articles: