当前位置:网站首页>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
边栏推荐
- ren域名有价值吗?值不值得投资?ren域名的应用范围有哪些?
- Is the account above changtou school safe?
- Huawei game failed to initialize init with error code 907135000
- Special topic of binary tree -- acwing 3384 Binary tree traversal (known preorder traversal, while building a tree, while outputting middle order traversal)
- js中给数组添加元素的方法有哪些
- How does the whole network display IP ownership?
- Binary tree topic -- Luogu p3884 [jloi2009] binary tree problem (DFS for binary tree depth BFS for binary tree width Dijkstra for shortest path)
- Gaode draws lines according to the track
- Appgallery connect scenario development practice - image storage and sharing
- Approximate sum count (approximate
猜你喜欢
Multi line display and single line display of tqdm
【IDEA】使用插件一键逆向生成代码
ImportError: cannot import name ‘Digraph‘ from ‘graphviz‘
The most detailed MySQL installation tutorial
C#多维数组的属性获取方法及操作注意
ctf 记录
V2x SIM dataset (Shanghai Jiaotong University & New York University)
tqdm的多行显示与单行显示
What are the software product management systems? Inventory of 12 best product management tools
Internship report skywalking distributed link tracking?
随机推荐
LVM操作
String (Analog
Appgallery connect scenario development practice - image storage and sharing
Win11 arm system configuration Net core environment variable
[quick application] win7 system cannot run and debug projects using Huawei ide
二叉树专题--AcWing 1497. 树的遍历(利用后、中序遍历,构建二叉树)
Multi line display and single line display of tqdm
【IDEA】使用插件一键逆向生成代码
Internship report skywalking distributed link tracking?
Luogu p5536 [xr-3] core city (greed + tree DP looking for the center of the tree)
How to implement tabbar title bar with list component
Importerror: impossible d'importer le nom « graph» de « graphviz»
Approximate sum count (approximate
QT learning diary 8 - resource file addition
Flink two Open, implement Batch Lookup join (attached source)
ctf 记录
[play with FPGA learning 5 in simple terms ----- reset design]
[quick application] there are many words in the text component. How to solve the problem that the div style next to it will be stretched
TIPC 寻址2
How to transfer event objects and user-defined parameters simultaneously in Huawei express applications