<title>Installation of MySQL under Windows</title> 1. Download Mysql-5.6.11-win32 and Unzip
If you unzip it to "H:\SoftWare\mysql-5.6.11-win32"
2. Setting up the configuration file
go to the Unzip directory and copy the My-default.ini copies of the My.ini
to modify a My.ini configuration item
[Mysqld]
basedir = "H:\SoftWare\mysql-5.6.11-win32"
DataDir = "H:\SoftWare\mysql-5.6.11-win32\data"
3. Add MySQL service
Right-click Cmd.exe Select "Run as Administrator"
then the CD command switches to the H:\SoftWare\mysql-5.6.11-win32\bin Directory execution Command
Mysqld-install The name of the service you want to set
such as:
H:\software\mysql-5.6.11-win32\bin>mysqld-install Mysql5.6
Service successfully installed.
4. Start the Mysql5.6 service
start "Run" services.msc, find Mysql5.6 service right click "Start"net start MySQL
3) Turn off MySQL
Click the Stop button in the MySQL service, or enter net stop MySQL in the command line (Run as Administrator).
4) Delete MySQL service
Mysqld–remove5.change the empty password for MySQL default system user root to 12345 command: mysqladmin-u root password "12345"
4 operation
Log in to the database:
C:\users\zhang10>mysql-u root-p
Enter Password: * * * (password initial value can be set to root or empty)
After entering MySQL, the command ends with a semicolon.
Show all the database schemas:
mysql> show databases;
Create a new database schema, specifying the encoding utf-8, otherwise garbled.
Create database md11uft8 character set UTF8;
Select this database Md11utf8:
mysql> use Md11utf8;
Create a table:
Mysql> CREATE TABLE basicinfo (ID int primary key auto_increment, name varchar (+) NOT NULL, age int. NOT NULL);
Insert data:
mysql> INSERT into Basicinfo (ID, name, age) VALUES (' 1 ', ' Zhang San ', ' 30 ');
mysql> INSERT into Basicinfo (ID, name, age) VALUES (' 3 ', ' John Doe ', ' 25 ');
Inquire:
Mysql> select * from Basicinfo;
+----+------+-----+
| ID | name | Age |
+----+------+-----+
| 1 | | 30 |
| 3 | | 25 |
+----+------+-----+
You can see that the value in name is not displayed (Chinese is not displayed).
When you insert a value in MySQL Workbench, the query is displayed correctly.
However, the query display in the command line is garbled (DOS does not support UTF8 from MySQL), resolved as follows:
mysql> set names GBK;
To change the root password:
Mysql>use MySQL;
Mysql>update user Set Password=password (' NewPassword ') where user= ' root ';
Mysql>flush privileges;
From for notes (Wiz)
Installation of MySQL under Windows