The basic operation of MySQL

Source: Internet
Author: User

MySQL is a must-have database for storing Superuser and managing some permissions.

Update user set Password=password ("123321") where user= ' root '; The password for Update root is 123321

Flush privileges; Refresh the database

Mysql-u root-p; Login MYSQL-U representative USER-P representative password

show databases; Displays all databases in the current system.

Create Database XXX; Create DATABASE xxx

Use XXX; Using Database xxx

Show tables; Show all tables in the current database

CREATE TABLE YYY (id int, name text, serial text); Create a Table yyy

Select *from YYY; Get all the information in yyy

Desc YYY; Show YYY details, fields

INSERT into YYY values (1, "Wow", "TH"); Inserting information

Select *from YYY WHERE name = "Wow haha"; Conditional filtering

Select 10*10; Results showing 100

Select Current_time; Show Current Time

Select Current_date; Show current date

Select version (); Display version Information

After logging in directly with Mysql-u root-p, many databases are missing. MySQL database are all meters.

Use Mysql-h 127.0.0.1-u root-p; After successful login, the database is OK.

Cause: In MySQL, there are actually different accounts for root.
[Email protected]
[Email protected]
[Email protected]
[Email protected]

[Email protected]%

[Email protected]% maximum permission, this percent is wildcard, that is, wildcard, can refer to any.

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.