当前位置:网站首页>Basic usage of MySQL in centos8
Basic usage of MySQL in centos8
2022-07-02 11:16:00 【N64-HanYeWei】
1、 Import hellodb.sql Generate database
Ready to install mariadb-server
yum -y install mariadb-server
systemctl enable --now mariadb.service



Import database and table files
(1) stay students In the table , Query age is greater than 25 year , And the name and age of the male students

MariaDB [hellodb]> select name students_name,age students_age from students where age>=25 and gender='M';
(2) With ClassID To group by , Show the average age of each group

MariaDB [hellodb]> select classid ,avg(age) from students group by classid;
(3) According to the first 2 The average age in the questions is greater than 30 And the average age

MariaDB [hellodb]> select classid ,avg(age) Average age from students group by classid having Average age >30;
(4) Display with L Information about the students with the first name

MariaDB [hellodb]> select * from students where name like 'L%';
2、 Database authorization magedu user , allow 192.168.1.0/24 Segments can be connected mysql
Preparation :




echo 1 > /proc/sys/net/ipv4/ip_forward-------- Turn on the routing function

MariaDB [(none)]> grant all privileges on *.* to 'magedu'@'192.168.1.%' identified by '123456';----------------- Create users and authorize them, but in mysql-8.0 This function has been canceled

[[email protected] ~]# mysql -umagedu -h10.0.0.6 -p123456
边栏推荐
- 对毕业季即将踏入职场的年轻人的一点建议
- Verilog 和VHDL有符号数和无符号数相关运算
- Indexer in C #
- SQLite modify column type
- Skills of PLC recorder in quickly monitoring multiple PLC bits
- Creation and use of unified links in Huawei applinking
- Flick two open, realized a batch lookup join (with source code)
- PKG package manager usage instance in FreeBSD
- spritejs
- Huawei game failed to initialize init with error code 907135000
猜你喜欢

V2x SIM dataset (Shanghai Jiaotong University & New York University)

MTK full dump抓取
![[in simple terms, play with FPGA learning 3 ----- basic grammar]](/img/f0/0204fa5197033877dc0758203253ae.png)
[in simple terms, play with FPGA learning 3 ----- basic grammar]

TIPC messaging3
![[AGC] how to solve the problem that the local display of event analysis data is inconsistent with that in AGC panel?](/img/66/674a06d8e45a31ae879b81554ef373.png)
[AGC] how to solve the problem that the local display of event analysis data is inconsistent with that in AGC panel?

ImportError: cannot import name ‘Digraph‘ from ‘graphviz‘

【深入浅出玩转FPGA学习3-----基本语法】

Verilog and VHDL signed and unsigned number correlation operations

Special topic of binary tree -- Logu p1229 traversal problem (the number of traversals in the middle order is calculated when the pre and post order traversals of the multiplication principle are know

JVM garbage collector
随机推荐
TIPC introduction 1
Gaode draws lines according to the track
Openmldb meetup No.4 meeting minutes
II Stm32f407 chip GPIO programming, register operation, library function operation and bit segment operation
[AGC] how to solve the problem that the local display of event analysis data is inconsistent with that in AGC panel?
Static variables in static function
[play with FPGA learning 5 in simple terms ----- reset design]
通过券商经理的开户二维码开股票账户安全吗?还是去证券公司开户安全?
Uncover the secrets of Huawei application market application statistics
二叉树专题--AcWing 1497. 树的遍历(利用后、中序遍历,构建二叉树)
Is the account above changtou school safe?
金山云——2023届暑期实习
【云原生】2.5 Kubernetes 核心实战(下)
Luogu p4281 [ahoi2008] emergency gathering / gathering (tree doubling LCA)
高德根据轨迹画线
PHP tea sales and shopping online store
MTK full dump grab
Is bond fund safe? Does the bond buying foundation lose principal?
二叉树专题--AcWing 19. 二叉树的下一个节点(找树中节点的后继)
C file and folder operation