Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the basic sentences commonly used in mysql

2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report