MySQL mount loading check character set encoding

Source: Internet
Author: User
Tags check character mysql client mysql delete

: https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.11-winx64.zip

Unzip the directory after extracting the zip

Create a new My.ini file inside the contents as follows

  [MySQL]
# Set the MySQL client default character set
Default-character-set=utf8
[Mysqld]
#设置3306端口
Port = 3306
# set up the MySQL installation directory

# Set up a storage directory for MySQL database data
Datadir=d:/java/software/mysql/data
# Maximum number of connections allowed
max_connections=200
# The character set used by the service side defaults to the 8-bit encoded latin1 character set
Character-set-server=utf8
# The default storage engine that will be used when creating a new table

1. Open Win+r cmd

2. D: Enter the drive letter where MySQL is located CD d:/java/software/mysql/mysql8.2/bin (installation directory)

3. Enter mysqld install (MySQL installation)

4. Input mysqld--initialize (Initialize)

5, input net strat mysql (start MySQL server) successful startup will appear MySQL boot successful words

6, first login once, mysql-uroot-p<br> casually lose

7, go back to this d:/java/software/mysql/data (database storage directory) directory next to one more (the local computer name. err file) opened with Notepad after the initialization password is found

8. Enter Mysql-uroot-p return

9. Enter the initial password

10, modify the initialization password: NOTE: The version is not the same as modifying the initialization password is not the same as mine is 8.0.12 Change Password command for

ALTER USER ' root ' @ ' localhost ' identified with Mysql_native_password by ' password ';

11. After installation, look at the database character set encoding (can also be viewed in the Management MySQL management tool)

//If you are logged in, you must log into the MySQL installation directory before you canShow variables like ' character_set_database ';

To view the encoding format of a table
show create table <表名>;

//创建表的指定格式
CreateTableTb_books (namevarchar45)NotNull, PriceDoubleNotnullint not nullvarchar (45) not Span style= "COLOR: #0000ff" >null) default charset = UTF8;

//Modify the encoding format of the database
< Span style= "COLOR: #0000ff" >alter database < database name > character set UTF8;

//Modify the encoding format of the data table
Altertable < name > character set UTF8;

Modify field encoding format
Mysql>Altertable < table name > change Span style= "COLOR: #808080" >< field name > < field name > < type > character set Utf8;mysql>alter table user change username username varchar (20) character set UTF8 not null;

12. Uninstall MySQL net Storp mysql (stop MySQL service)

13. Delete the sc delete mysql or mysqld remove MySQL

14. Uninstall MySQL to find the registry (regeidit) hkey_local_machine\system\controlset001\services\mysql

              Hkey_local_machine\system\controlset002\services\mysql

              Hkey_local_machine\system\currentcontrolset\services\mysql

Three A look inside, there is MySQL delete no, forget it.

Summary: MySQL installation--view character set encoding--delete MySQL Services--complete

MySQL mount loading check character set encoding

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.