1. Unzip the MySQL compression package, copy the package My-default.ini, rename it to My.ini, add the configuration information to My.ini;
[Client]
port=3306
Default-character-set=utf8
[Mysqld]
#skip-grant-tables
port=3306
Character_set_server=utf8
#解压目录
Basedir=d:\java\mysql5
#解压目录下data目录
Datadir=d:\java\mysql5\data
[Winmysqladmin]
D:\Java\mysql5\bin\mysqld.exe
Note: After the MySQL free install version decompression, the folder does not have data, the next step will automatically generate the Data folder. The data address can be pre-set in DataDir.
2. Add Environment variables
Variable name: mysql_home
Variable Value: D:\JAVA\MYSQL5 #mysql解压目录
3. Modify the path variable in the system variable
Add a variable value to the original variable value:;%mysql_home%\bin
4. Configure the database service
1> as an administrator into the command prompt, go to the MySQL extracted directory
2> Enter the service installation command in turn:
Mysqld--console
Mysqld--initialize
Mysqld Install
Successful installation will prompt the service installation success;
Note: 1. Execute the above three instructions, because mysql5.* the latest version of the Data folder, the above steps to automatically generate data files;
2. Execute the last instruction, the installation can be prompted to install the service, may be the previous error operation caused, can be removed by mysqld remove;
5. Start the MySQL service
Method One:
The Start service command is: net start MySQL
Method Two:
Open the Administration Tools service and locate the MySQL service.
Start the service by right-clicking to start or by tapping on the left-hand boot directly.
6. Change the root account password
1>. Modify the MySQL configuration file (My.ini) and add a line under [Mysqld] Skip-grant-tables
2>. After MySQL restart, you can enter directly with Mysql-u root-p (the password is empty at this time)
3>. mysql> Update Mysql.user Set Authentication_string=password (' 123qaz ') where user= ' root ' and Host = ' localhost ';
4>. mysql> flush Privileges;
5>. Mysql> quit;
6>. Restore the/etc/my.cnf file (delete the Skip-grant-tables line) and restart the MySQL service
7>. This time you can use Mysql-u root-p ' 123qaz ' to enter the
8>. Mysql>set PASSWORD = PASSWORD (' 123456 '); Set a new password
It is everyone's responsibility to protect the original knowledge, starting from me. article content transferred from http://blog.csdn.net/frt007/article/details/50184143
MySQL free install database configuration-windows8.1