Learn to use the MARIADB database
1.yum Search MARIADB Query the package you want to pack
2.Yum Install mariadb-server.x86_64-y Installation Services
3.netstat-antlpe | grep mysql View Interfaces Loopback interface is 127.0.0.1
vim/etc/my.cnf Configuring Interfaces
Skip=networking=1
Log=arror=/var/log/marriadb.log
Pid-file=/var/run/mariadb.pid
local connection only via socket file, blocking all tcp/from the network IP Connection
4.systemctl Stop Firewalld.service
5.systemctl start mariadb
6.mysql_secure_installation The first time you open the database for initial configuration
7.mysql-uroot-p
redhat standard into database format
8.SHOW DATABASES; Display Database
9.useMySQL; Enter the database
SHOW TABLES; Displaying tables in a database
One .DESC User; View the data structure of the user table
FLUSH privileges; Refreshing database Information
slect host.user,password from user; Querying the Host,user,password field in the user table
14. Database Insert, delete, create operation
Create database Westos; creating Westos databases
Use Westos;
CREATE table Linux (creating tables, Username,password fields
Username varchar () NOT NULL,
Password varchar () not NULL);
SELECT * from Mysql.user; Querying the user table under the MySQL library
ALTER TABLE Linux ADD age varchar (ten); Adding age to a Linux table
ALTER TABLE Linux DROP age; Delete age
ALTER TABLE Linux ADD Age VARCHAR (5) after name; Add an age after the name field
SHOW Tanles;
DESC Linux;
INSERT into Linux values (' user1 ', ' passwd1 ');
Insert a value of username = User1,password = Password1 in a Linux table
UPDATE linux SET password=password (' passwd2 ') WHERE username=user1;
Change the password for User1 in the Linux table is Password2
DELETE from Linux WHERE username=user1;
Delete the contents of User1 in the Linux table
GRANT SELECT on *. * to [email protected] identified by ' passwd1 ';
the authorization user1 password is passwd1 and can only query the database locally, so the content
GRANT all on mysql.* to [email protected] '% ' identified by ' passwd2 ';
authorization user2 password for PASSWD2 can log in to MySQL from any remote host and can operate on MySQL database arbitrarily
This article is from the "12147236" blog, please be sure to keep this source http://12157236.blog.51cto.com/12147236/1878740
"Linux rookie 2" MARIADB service