A little bit of MySQL application

Source: Internet
Author: User
Tags mysql code

First, download MySQL database

We're going to download it in version 5.7.

This is a 32-bit computer: Https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.18-win32.zip

This is a 64-bit computer: Https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.18-winx64.zip  

Download the unzip on the line, the contents are as follows

  

the extracted file name is mysql-5.7.18-winx64

second, the installation of MySQL service

1. Run the command prompt as an administrator. Such as

 2. Use the command prompt to enter the bin directory under MySQL

Find the extracted mysql-5.7.18-winx64 on the computer and enter into the bin, as

  

  Click the Address bar to copy the address, enter the CD at the command prompt and the address you just copied, F:\java\mysql-5.7.18-winx64\bin,

such as: CD F:\java\mysql-5.7.18-winx64\bin carriage return, and then enter the file where the letter, enter.

  

3. For 5.7 directory without data, you need to create one with mysqld--initialize-insecure--user=mysql This instruction, such as:

  

 F:\java\mysql-5.7.18-winx64, this is not a more data directory.

  

4. Install the service, run the command mysqld-install, such as:

  

  If you are prompted to do so, such as

  

  Already installed service can be used Mysqld-removel to cancel before, do not need MySQL, also can use, such as:

  

5. Run the service, run the MySQL service with the net start MySQL command to run, such as:

  

  If you need to configure whether booting up MySQL can be configured within the Windows service.

third, client testing

Run mysql-uroot-p this login command, where-U is the user name default is root,-p is the password default NULL, such as:

  

iv. Modify username and password

1. Run the command to toggle the data use mSQL, such as:

  

2. Run the command update user SET Authentication_string=password (' 123456 ') where user= ' root ', such as:

  

3.FLUSH privileges; This command is refreshed to allow permissions to take effect, such as:

4. Log back in to MySQL, enter exit, then enter the mysql-uroot-p password, such as:

  

v. Modifying the character encoding of MySQL

1. Check our MySQL code, need show variables like "%character%";

  

2. Create a new My.ini file in the mysql-5.7.18-winx64 directory,

 Open with Notepad, the content is

[Mysqld]

Charcter_set_server=utf8 and

[MySQL]

Default-character-set=utrf8

  

  This will not take effect until the MySQL service is restarted because only the startup service will read the file.

  

 Quit MySQL, log back in to MySQL, enter query instructions

  

Finally, it's done.

  

A little bit of MySQL application

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.