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.