REDHAT7 Install mariadb (original MySQL)
Installation:
# Yuminstall MARIADB Mariadb-server
Start up and boot up:
#systemctl Start mariadb
#systemctl Enable MARIADB
the root password for MySQL is empty at this time
# Mysql–uroot
Open firewall:
#firewall-cmd–permanent–add-service=mysql
#firewall-cmd--reload
# vi/etc/my.cnf (mysqld )
skip-networking= 1 (closed remote connection via IP , default is allowed)
: Wq
Link Blur query
Link '%a% ' with the letter a in the middle
Link ' _a% ' ends with a
Link '%a_ ' begins with a
Statement examples (note distinguishing functions, fields, table names):
Select *from worker where Sal >= 2500;
Select *from Worker where sal! = 2500;
Select*from worker where Deptno in (2,4);
Select *from worker where Sal between and 2500;
Selectavg (SAL) from worker;
Selectmax (SAL) from worker;
Selectmin (SAL) from worker;
Select *from worker order by Deptno; (in ascending order)
Select *from worker order by deptno Desc; (descending order)
Selectdeptno,max (SAL) from the worker group by Deptno;
CreateTable Test AS SELECT * from worker;
Internal connection:
Selectstudent,sno,student.sname,coll.cname from student join Coll Onstudent.cno=coll.con;
Left Outer connection:
Select S.sno,s.sname,c.cnamefrom student as S left joins Coll as C on S.cno=c.cno;
Right connection:
Select S.sno,s.sname,c.cnamefrom Coll as c right joins student as s on S.CNO=C.CNO;
This article is from the "Linux" blog, so be sure to keep this source http://yangzhiming.blog.51cto.com/4849999/1721717
REDHAT7 Install mariadb (original MySQL)