Mysql installation-free version configuration tutorial, mysql installation-free version
This article provides an example to share with you the installation-free mysql configuration tutorial for your reference. The specific content is as follows:
1. Download the MySQL installation-free compressed package and decompress it to a custom directory, for example, D: \ program0 \ mysql (this directory is used as an example below)
2. Modify the my. ini file (possibly a my-default.ini, manually changed to my. ini );
Items to be configured:
basedir =D:\program0\mysqldatadir =D:\program0\mysql\data
# If you want to customize this directory, you must move all the files under this directory to the new custom directory.
Port = 3306
Server_id = 10
3. Configure the default encoding of the new data path:
In the my. ini file,
Under [mysqld]
Add character_set_server = gbk
4. Add Environment Variables
Create variable MYSQL_HOME
Input variable name: MYSQL_HOME
Input variable value: D: \ program0 \ mysql
2) Add Path
Click Edit
Add the variable value to the variable value:
'% MYSQL_HOME % \ bin'
Note that this variable is added after the original variable value and separated by;. The original variable value cannot be deleted,
5. register the mysql service:
1) log on to the bin directory under the MySQL extract directory from the console (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 you open the cmd.exe program. This is also true when you start the Service.
# After the installation is successful, a message is displayed, indicating that the service is successfully installed.
# The command for removing a service is 'mysqld delete'
6. Start the mysql service: Run cmd to enter the console.
Net start mysql
7. Close the mysql service: Run cmd to go to the 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;
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.