当前位置:网站首页>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
边栏推荐
- [quick application] win7 system cannot run and debug projects using Huawei ide
- PHP tea sales and shopping online store
- QT learning diary 8 - resource file addition
- 二叉树专题--AcWing 19. 二叉树的下一个节点(找树中节点的后继)
- Verilog and VHDL signed and unsigned number correlation operations
- 高德根据轨迹画线
- 【深入浅出玩转FPGA学习4----漫谈状态机设计】
- ren域名有价值吗?值不值得投资?ren域名的应用范围有哪些?
- 【云原生】2.5 Kubernetes 核心实战(下)
- Special topic of binary tree -- acwing 3384 Binary tree traversal (known preorder traversal, while building a tree, while outputting middle order traversal)
猜你喜欢

【深入浅出玩转FPGA学习5-----复位设计】

【AI应用】海康威视iVMS-4200软件安装

TIPC messaging3

Special topic of binary tree -- acwing 47 Path with a certain value in binary tree (preorder traversal)
![[AI application] Hikvision ivms-4200 software installation](/img/4e/1640e3cafac13ce4d39520195c3217.png)
[AI application] Hikvision ivms-4200 software installation
![[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?

TIPC addressing 2

Verilog 和VHDL有符号数和无符号数相关运算

webauthn——官方开发文档
![[play with FPGA learning 2 in simple terms ----- design skills (basic grammar)]](/img/50/22f2fa8fd606572b13a18cc889ca2e.png)
[play with FPGA learning 2 in simple terms ----- design skills (basic grammar)]
随机推荐
TIPC Service and Topology Tracking4
Logu p3398 hamster looks for sugar (double LCA on the tree to judge whether the two paths in the tree intersect)
CentOS8之mysql基本用法
TIPC introduction 1
Special topic of binary tree -- acwing 1589 Building binary search tree
ros缺少catkin_pkg
JS——每次调用从数组里面随机取一个数,且不能与上一次为同一个
Calculate the sum of sequences
Luogu p5536 [xr-3] core city (greed + tree DP looking for the center of the tree)
String (Analog
V2X-Sim数据集(上海交大&纽约大学)
TIPC messaging3
二叉树专题--AcWing 1589. 构建二叉搜索树
Verilog and VHDL signed and unsigned number correlation operations
What are the software product management systems? Inventory of 12 best product management tools
MTK full dump抓取
从ros1到ros2配置的一些东西
TIPC protocol
enumrate的start属性的坑
Special topic of binary tree -- acwing 3384 Binary tree traversal (known preorder traversal, while building a tree, while outputting middle order traversal)