Mysql installation, mysql

Source: Internet
Author: User

Mysql installation, mysql

1. Install Mysql

1. Run cmd (administrator Version, otherwise you do not have permission) to switch to the mysql bin directory.

2. Run the command mysqld-install to install the service.

3. If you do not need mysql, you only need to run mysqld-remove to remove it.

4. Run net start mysql to start the service and run net stop mysql to stop the service.

5. Run mysql-uroot-p. The default password is empty for logon.

6. Set character encoding

Client

[Mysql]

Default-character-set = utf8

 

[Mysqld]

 

Character_set_server = utf8

7. Run the command show variables like "% character %"; view the system character set variables (the semicolons must not be less)

 

8. use mysql to switch Databases

UPDATE user SETPassword = PASSWORD ('000000') WHERE user = 'root'; Change PASSWORD

Flush privileges; refresh the page for the set password to take effect

Exit

Mysql-uroot-p123456 Log On with the SET Password

 

 

1. Create a database

Create database oa;

Use oa;

 

Ii. Create a table

Create table t_user (

Id int primary key auto_increment,

Username varchar (20 ),

Sex varchar (20)

);

 

Select * from t_user;

 

3. insert

Insert into t_user (username, sex) values ('xiaoming ', 'male shy ');

Insert into t_user (username, sex) values ('little red', 'female shilles ');

 

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.