Mysql installation and configuration
1) Mysql configuration file modification
mysql-5.7.11The default configuration file is in mysql/my-default.ini, or create a my.ini file yourself
---------------- -------------------------------------------------- ----------------------------
My.ini reference content
[mysqld] basedir="D:/Program Files/mysql-5.7.15-winx64" datadir="D:/Program Files/mysql-5.7.15-winx64/data" port=3306 default-character-set=utf8 default-storage-engine=innodb character_set_filesystem=binary [client] port=3306 default-character-set=utf8 [mysql] default-character-set=utf8
---- -------------------------------------------------- -------------------------------------
2) Configure environment variables
#--------------------------------- -------------------------------------------------- ---------
Configure the bin directory path of mysql to path (no detailed introduction)
-------------- -------------------------------------------------- ----------------------------
3) Install mysql
---------------------------------------- -------------------------------------------------- -
Open cmd and run: mysqld -install
Run services.msc and see that there is indeed a file named MySQL Served
------------------------------------------------ --------------------------------------------------
4) Initialize the data directory
--------------------- -------------------------------------------------- ---------------------
Open the mysql installation directory. If there is no data folder in it, enter in cmd: mysqld --initialize-insecure
Generate user data with root as user name and empty password
Note:
mysqld --initializeAutomatically generate a random passwordroot User, Cannot log in without password.
This command cannot be executed if the data folder is not empty. You can delete the data folder first and re-execute the previous instructions
-------------------------------- -------------------------------------------------- ----------
Enter select version() in mysql to view the version information of mysql
5) Enable the mysql service and log in to the settings password
------------------------------------- -------------------------------------------------- ----
Start mysql service
cmd input: net start mysql
Log in to mysql
cmd input: mysql -u root -p
password: Press Enter directly here
Set password
set password for root@localhost = password('New password ');
------------------------------------------------ --------------------------------------------------
How to delete MySQL
1) Shut down the service
net stop mysql
2) Delete the service item
c:\mysql\bin\mysqld-nt.exe -remove
3) Delete the corresponding file Just clip it
The above is the detailed introduction of the installation and configuration of the MySQL compressed version. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!