How to configure the decompressed version of mysql: first initialize the data directory; then install the MySQL service, the code is [bin\mysqld --install]; finally switch to the bin directory and execute the command [net start mysql].
Method to configure the decompressed version of mysql:
1. First download the MySQL community server from the MySQL official website Version (MySQL Community Server). Click [Downloads] - [MySQL Community Edition] - [MySQL Community Server] in sequence, and finally select [Windows (x86, 64-bit), ZIP Archive] in the download list. After downloading the compressed package, unzip it to an installation directory.
2. Find the my-default.ini configuration file in the extracted folder, copy it to a new ini file, and rename it to my.ini. Open it for editing, add a line under [client]: default-character-set=gbk, and then set basedir and datadir.
[mysqld]
#Set the installation directory of mysql
basedir=C:\MyInstalledSofts\mysql-5.7.17-winx64
#Set mysql The data storage directory of the database must be data, or \\xxx\\data
datadir=C:\MyInstalledSofts\mysql-5.7.17-winx64\data
3. Add the environment variable MYSQL_HOME, and the variable value is the installation directory path of MySQL. Add ";%MTSQL_HOME%\bin;" to the environment variable path
4. Initialize the data directory. In the command prompt, change the directory to the MySQL installation root directory, and then execute the command: bin\mysqld --defaults-file=my.ini --initialize-insecure.
5. Install the MySQL service. Or execute the command in the MySQL installation root directory: bin\mysqld --install. After the installation is successful, it will prompt "Service successfully installed".
#6. Finally, switch to the bin directory and execute the command: net start mysql to start the MySQL service you just installed. After successful startup, you can use MySQL normally.
Related free learning recommendations: mysql database(Video)
The above is the detailed content of How to configure the decompressed version of mysql. For more information, please follow other related articles on the PHP Chinese website!