A base Mysql

A: Mysql acquaintance

why:

  1.1 data files and programs should not be placed on the same machine! Once the machine is hung up, hung up all data and programs can not provide services.

  1.2 there is a limit longitudinal extension, transverse extension may solve the bottleneck problem.

  1.3 Although you can use code to manipulate the data inside the file, but the code inside the file operation data is very troublesome.

  1.4 to solve the problem of concurrent file operations, deployment of multiple machines operating with a file must have concurrency problems, connection problems, data consistency problems, etc., either inefficient or complicated by insecurity.

  1.5 developer can develop the program based on the data, the code must write their own socket, to connect the client and server side, and then transfer the data.

what:

Mysql has written socket code, not the developers to write their own

Developers can focus management operations without data, you can withdraw up to concentrate on your logic code

Mysql is a C S architecture, software / database management to help us solve these problems of efficiency, concurrency issues, stability, data consistency problems

Architecture, mysql master-slave replication, multi-node deployment, even hanging one, open a node, immediately synchronize data from other nodes can provide services, does not affect the use of

Mysql is a database management software that helps us manage the database, specifically how to operate complex operational data to complete it, you just need to tell him by sql statement you want to do, it will be very efficient completion.

Of course, Mysql is not the only DBMS, ORACEL, SQLSERVER are all good DBMS. Do not cheap money, better performance, although the acquisition by Oracle, there mariaDB to address the risk Mysql closed source.

When installing mysql on linux will find mariaDB are used instead of mysql, but changed the name, no change in other operations.

II: comb concept

Database: is the folder

Table: that file will contain the data, the column called field line call recording

Mysql is the efficient management of data storage, a data query system software.

mysqld to be responsible and deal with client

Database server: Install the DBMS computer, high performance

Table structure: desc tablename view the table structure, field names, field types, constraints, etc.

Database Category:

Relational Database: There are table structure

Non-relational databases: the table structure is not, the data is stored in the form of key-value pairs

Three: Installation Mysql

windows all the way to install is little point

Installation linux, yum install -y mysql-server mysql, now replaced mariadb

  1. Start mysql: systemctl start mariadb

  2. Set the boot: systemctl enable mariadb

  No password 3. After the installation, enter mysql, mysql -uroot -p directly enter into without a password

  4. Set the password set password = password ( "123")

  5.select user (); view current user, and allows the log ip

  Under 6.root authority, create a new user: the Create the User "abc" @ "192.168.1.1" IDENTIFIED by "123"; ----- At this point this is the only ip can be user name abc password to log 123, percentile No. wildcard.

    6.1 the Create the User "GYX" @ "192.168.1%." IDENTIFIED by "123"; restricted to a certain segment

    6.2 Create User "GYX" @ "%" IDENTIFIED by "123"; all machines can be connected

  7. The newly created user, see the database, show databeses; limited, which requires authorization to see the database tables, as well as operating restrictions

    . 7.1grant all on * * to "abc" @ "%"; open to the user all the permissions abc

    7.2flush privileges; refresh permissions take effect immediately

 6 & 7 merge: Create a user and authorization: Grant * to * All ON 'EVA' @ '%' IDENTIFIED by '123'; one step.

Four: Profile

Five: Basic Operation

show databases; Database View all

use databasename; select a database, which is equivalent to open a folder

show tables; show all data tables

descc tablename; see table structure

Base sql

 

Guess you like

Origin www.cnblogs.com/gyxpy/p/11563432.html