Installation of MySQL under Windows

Source: Internet
Author: User

<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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.