Linux Series - Advanced command --mysql database installation
Warehouse database is used to organize, store and manage data
1, the installation database: Run yum -y install mysql -server
2. Start the database: the installation is complete, execute the command service mysqld start
3, Log database: MySQL -u root -p password after a carriage return ( masql default user name is root password is blank) where -u user -p represents the password.
4, database: After switching to a successful login mysql amount of data, input: use mysql
5, if you do not know, you can automatically go online to find the mysql service resources to complete the download to complete the installation
6, connected to the database: using Navicat for mysql connection database
(1) from the user queries the table all the users can log on and support for host connection: the SELECT user, Host, password from user; ( remember mysql statement is the end of the semicolon )
(2) user table host field is displayed % or localhost difference when
(3) New root user, and the user gives to all databases and operating authority and all its objects, this statement in the empowerment % representatives support any host to connect to mysql server, this is the case with navicat This client is certainly no problem the empowerment statement: Grant to All privileges ON * *. 'root' @ '%' IDENTIFIED by'123456 'with the Option Grant;
Where the host representation allows the local host to log does not allow remote logins.
% Indicates that the client can connect clients to give all rights, CRUD, can open a table plan for library
* * : The first asterisk to represent all the database, and the second represents the corresponding database table, MySQL can perform all database open
to: contract that gives the user rights
@% Give all clients can access
Identified by: means the mysql among Password
(4) If the connection is not on, the cloud server security component, open 3306 port ( MySQL default port)
Internal server, turn off the firewall
Navicat for mysql connecting step and the abnormality cause
Create a connection, through navicat for mysql local remote operation of the database
1, fill in the server IP
2. Fill in the username and password
3, connection test
Connections are not possible causes
1, the connection information is not correctly filled
2, the virtual machine does not start mysql service
3, cloud server security group is not open 3306 port
Mysql uninstall procedure
yun command uninstall the mysql
Yum -y remove mysql *
Find mysql installation file
find / -name mysql
With rm -rf delete Find out mysql file
note:
1, sql statement should end with a semicolon, text input
2, Service mysqld start / stop mysql server is shut down
Network knowledge
The difference between internal and external network:
Also known as local area network or a private intranet, extranet called wide-area LAN or public network
LAN B access can not publish in the local area A in the project site, but local area network A can access the project website to publish outside the network
Local computer needs to access the test environment to ensure that in the same local area network, to ensure that the same IP network segment.
1, Tap and udp difference is tcp is a reliable transport protocol, because of the need to establish a connection to the transmission of data, udp is not.
2, TCP connection is established handshake 3 times, disconnect shake hands 4 times.
Continuous shaking hands 3 times: A , B sender and receiver function properly
First: A -> B message, B receives the message ( B know: B receiving capacity of the OK , A transmits the OK )
Second: B -> A message, A receives the message ( A known: B transmission capability of the OK, A transmitting receiving the OK )
Third: A ---> B message, B receives the message ( B know transmitted the OK )
Disconnect: waving 4 times
First: A -> B, tell B , the data transmission is completed, the need to disconnect
Second: B -> A, told A , let A and so on, and so B receives the complete data before disconnecting
Third: B ---> A, data transfer over. Can be disconnected
Fourth: A ---> B , later XX seconds after will be disconnected.