MySQL Basic use

Source: Internet
Author: User

#登录

Mysql-uroot-p123

#查看用户

Select User ();

#退出

Quit

Exit

\q

#查看帮助信息

Help create user;

#创建账号

Create user ' Egon ' @ ' 192.168.11.* ' identified by ' 123 ';

Create user ' Egon ' @ ' 192.168.11.1 ' identifled by ' 123 ';

Create user ' Egon ' @ '% ' indenrified by ' 123 ';

#授权

Grant all privileges

Grant all on db1.t1 to ' Egon ' @ '% ';

Grant all on * * to ' egon ' @ '% ';

Refresh

Flush privileges;

#创建账号同时授权

Grant all on * * to ' DJJ ' @ ' percent ' identified by ' 123 ';

Flush privileges;

#远程连接mysql

show databases;

#修改密码

Command line "Mysqladmin-uroot-p ' 123 ' password 123

Command line "\mysql-uroot-p123

#破解密码

Kill MySQL Service

>tskill |findstr MySQL

>tskill mysqld

>tskill-f/pid 5320

>mysql--skip-grant-tables #跳过授权表启动

Mysql>update mysql.user Set Password =password (") where user= ' root ' and host= ' localhost ';

MySQL >flish privileges;

Tskill mysqld

tasklist |findstr MySQL

Mysqld

Sign in with a new password

MySQL Basic use

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.