Get the App
SLTechnology News&Howtos  ›  Database  › 

What are the basic sentences commonly used in mysql

Shulou Source: shulou.com Published: 2022-06-01 18:25:33 10月04日 Update

Below I will give you a brief talk about mysql what are the common basic sentences, you know before the related similar topic content? Interested in the words to take a look at this article, I believe that after reading mysql what are commonly used basic sentences to help you a little bit.

create user shenge1@'192.168.200.% ' identified by 'linwei'//Create a user

grant all privileges on *.* to shenge1@'192.168.200.% ' identified by 'linwei'//Assign permissions to this user.

flush privileges;

grant permissions on database objects. table to user @ip identified by password

Permission: RESOLUTION SLACE, RESOLUTION CLIENT

Database object:*.* (*.* Description database. Table name)

User: shenge1 The % sign is a wildcard, indicating that user relp can log in to the service where 192.168.200.1~192.168.200.254 is located Password:linwei

mysql -ub -hwww.a.com -pb; You can log in directly, username b, password b,www.a.com is mysql Cloud Virtual Machine address

mysql -u shenge1 -h 192.168.200.157--password=linwei Login or-p Enter password manually

mysql

< 01.sql =>

In 01.sql write mysql statement, you can execute it like this.

mysql -u shenge1 -h 192.168.200.157 --password=linwei < 01.sql

delete from mysql.user where User='age 1'; Delete a user

show databases; Show all databases

show tables from mysql; Displays all table names in the mysql database

create student database; create a student database

drop database student

create test table.student(char name,math int); Create a student table in the database test

drop table test.student; Delete the student table in the test database

show columns from table names or describe table names View table structure

insert into test.student(name,math)values ('xiaoming ',87); insert data

alter table test.student drop name; delete this field name.

alter table test.student add name char(20); add name

update test.student set name="xiaoming" where math=78; update the value of a data

What do you think of mysql commonly used basic sentences in this article, whether there is harvest. If you want to know more about it, you can continue to pay attention to our industry information section.

Tags: Data database user statement password commonly used field object permission article table service login following text topic interest content address location manual Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology MariaDB OPPO Reno Apple vpn