First of all, let's briefly introduce what is MySQL;

In short, a database is a warehouse for storing data , In order to facilitate data storage and management , It stores data on disk according to specific rules . To achieve a certain purpose , A collection of data organized according to certain rules ;

MySQL Is an open source relational database management system (RDBMS), Use the most commonly used database management language -- structured bai query language (SQL) Database management . Through the database management system , It can effectively organize and manage the data stored in the database .

So our common database model :

1, Relational database



SQL Server

2, Non relational database

2,1 Document storage database MongDB

2,2 The key stores the database Redis Memcached

2,3 Column store database HBase

2,4 Graphic database Neo4J

What are the interview questions about the database in the company ?

1,SQL Statement operation database

2,SQL Statement operation table structure

3, The relationship between a table and a class The relationship between fields and properties

The table corresponds to java Class in , It is used to store the data extracted from the database

Field name ( Column ) Consistent with the properties of member variables in a class

The rows in the table are based on the objects created by the class

3,SQL Introduction of statements :

MySql incognizance java, So you need to interact , Need to know the language of the database

SQL Statements are the data code base

1. Environment

virtual machine : centos7


① The first thing to do is to put MySQL Install the package

MySQL Official website :

① ,

② ,

③ ,

④ ,

⑤ ,

Follow these steps to mysqi The compressed package has been downloaded to the computer

Next, open the virtual machine and use remote tools xshell Connect &CRT Connect . I'm going to use xshell

xshell6 Download package

link :
Extraction code :qa62

Virtual machine is not introduced here , There are many ways to install virtual machines on the Internet
① Turn on the virtual machine and leave it alone ;

② Open it directly xshell Input IP Create a remote connection

③ Input the user password

④ Login successful

3. The main course begins

adopt  rpm -qa | grep mariadb Command view  mariadb Installation package

② And then by order rpm -e mariadb-libs-5.5.56-2.el7.x86_64 --nodeps uninstall mariadb

③ And then through rpm -qa | grep mariadb see mariadb

④ Through  cd /usr/local/ Command into the root directory usr In the catalog local Catalog , This directory contains some local shared resources

⑤ Through  ll Take a look at the directory structure

⑥ Through  mkdir mysql command Create a name in the current directory mysql The catalog of , also ll Take a look at the new mysql Catalog

⑦ Through cd mysql Get into mysql Catalog , Again ll Take a look at the directory structure

⑧ And then through rz The command was downloaded before it was uploaded mysql Data packets

⑨ Upload completed

A And then through ll View the current directory structure

B , adopt tar -xvf mysql-8.0.11-1.el7.x86_64.rpm-bundle.tar  command decompression  tar package

C , adopt clear Order clear the screen

D , adopt  rpm -ivh mysql-community-common-8.0.11-1.el7.x86_64.rpm --nodeps --force Command to install  common

E , adopt  rpm -ivh mysql-community-libs-8.0.11-1.el7.x86_64.rpm --nodeps --force  Command to install  libs

F , . adopt  rpm -ivh mysql-community-client-8.0.11-1.el7.x86_64.rpm --nodeps --force  Command to install  client

G , adopt  rpm -ivh mysql-community-server-8.0.11-1.el7.x86_64.rpm --nodeps --force  Command to install  server

H Through rpm -qa | grep mysql View installed mysql resources

I Enter the following command

mysqld --initialize initialization

chown mysql:mysql /var/lib/mysql -R to grant authorization
systemctl start mysqld Turn on mysql service
systemctl status mysqld see mysql state
J Through cat /var/log/mysqld.log | grep password see root Initial password

K Use root The user login mysql , And modify it root User password

mysql -u root -p # Enter and enter the initial password, which is The initial password shown above ( Fill in your own password )

Then input alter user "root"@"localhost" identified by "Aa123456";             # Change Password (Aa123456 The password you set for yourself can be changed at will )

L And then exit sign out Verify the password

M By the following command , Authorization for remote access

create user 'root'@'%' identified with mysql_native_password by 'Aa23456';    
grant all privileges on *.* to 'root'@'%' with grant option;
flush privileges;      # Immediate effect

N Through  ALTER USER 'root'@'localhost' IDENTIFIED BY 'root' PASSWORD EXPIRE NEVER; Command to modify the encryption rules ,MySql8.0 edition and 5.0 The encryption rules are different , Now visualization tools only support the old encryption method .

O Through  flush privileges; Command to refresh the permissions after the repair

P ,

By the following command , close firewall

systemctl stop firewalld.service;
systemctl disable firewalld.service;
systemctl mask firewalld.service;

Q Through  yum -y install iptables-services  Command to install iptables A firewall

R Start and set up the firewall through the following command

systemctl enable iptables;
systemctl start iptables;

S Through vim /etc/sysconfig/iptables Command edit firewall , Add port

-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8090 -j ACCEPT

U Through  systemctl restart iptables.service Command to restart the firewall to make the configuration take effect

V Through  systemctl enable iptables.service Command to set the firewall to boot

W Through  ifconfig Command view ip

X New  SQLyog  The connection of

SQLyog My bag

link :
Extraction code :qa62

Y The connection is successful

Z Use the command show databases; View all databases

MySQL The installation is over , But this is just the beginning There are still many orders to add, delete, change and search come on. .

Centos7 Lower installation MySQL8.0.23- More articles about the beginning of Xiaobai

  1. centos7 Lower installation mysql8.0.12 And set permissions

    One .mysql Version introduction mysql Our official website is : Multiple versions can be seen on the official website , The main versions are as follows , 1.MySQL Community Server Community version , Free open source ...

  2. Centos7 Lower installation Mysql8.0

    Suddenly found that mysql There are 8.0 了 , And the performance improvement is obvious , Just pretend to play . centos Of yum The default in the source is no mysql Of , So we need to go to the official website to download mysql Of repo Source and install : Official website :http://dev ...

  3. centos 7 Lower installation mysql-8.0

    This article mainly introduces in centos7 Installation in environment mysql8.0 And set it to start automatically . Installation steps 1. To configure yum Source First, in the  ...

  4. CentOS7 Offline installation MySQL8.0

    CentOS7 Offline installation MySQL8.0 Uninstall software rpm -e --nodeps Package to uninstall root@jacky zookeeper]# rpm -e --nodeps java-1.6.0-o ...

  5. Centos7.4 Lower installation Mysql8.0.15

    One . download Mysql Mysql Download address : Two . uninstall Linux Self contained mariadb    install Mysql Need to unload before maria ...

  6. Windows Installation in environment mysql-8.0.11-winx64 Solutions to problems encountered

    download mysql Installation package , My goal is to download mysql-8.0.11-winx64, Unzip to the directory you want to install , Then configure the environment (window In the environment ,mac Ben hasn't tried yet ), 1. First , Configuration environment : Right click this computer -> attribute -& ...

  7. windows10 Lower installation mysql-8.0.15-winx64 And some problems encountered in the process of connecting to the server

    One . Download installation configuration mysql-8.0.15 1. Official website ( download zip package 2. Unpack to my D:\mysql Under the table of contents 3. by mysql with ...

  8. Windows10 Lower installation MySQL8.0

    1: First go to the official website to download the installation package Download address : This is the version I downloaded 2: Unzip the unzip file to your installation directory :E:\mysql-8.0.11-wi ...

  9. Mac Lower installation mysql8.0.11

    1. download MySQL Community  edition :8.0.11, This example is based on dmg How to install , The downloaded file is called :mysql-8.0.11-macos10.13-x86_64.dmg Download address :https:/ ...

  10. CENTOS7 Lower installation REDIS4.0.11

    Copy Collection for private use , Nothing else , Original blog address : 1. install redis First step : download redis Installation package wget ...

Random recommendation

  1. dsp28377 control DM9000 Sending and receiving data —— The second edition of the program , It can realize the operation function , But it's easy to drop frames ; Use the method of reading interrupt register to judge interrupt

    G:\controlSUITE\device_support\F2837xD\v180\F2837xD_examples_Cpu1\emif1_16bit_asram\cpu01\emif1_16bi ...

  2. Key Figure、Exception Aggreagion、Non-Cumulative KeyFigure

    Statement : Original works , Please indicate that the article is from SAP Abbess technology blog ( Bo / customer / garden, And indicate the original source of the article in the form of hyperlinks , Otherwise it would be ...

  3. JavaBean Examples of basic usage ( Two )

    JavaBean The second use of , It's reception form Component request assignment . One . modify person class . Because this time it's a data transfer between two web pages , Affected by the Chinese garbled problem , So in person Class to add a function for transcoding , And in every ...

  4. Malware Defender(HIPS Active defense software ) V2.8 Free version

    Software name : Malware Defender(HIPS Active defense software ) V2.8 Free version Software language : Simplified Chinese Authorization way : Freeware Running environment : Win7 / Vista / Win2003 / Win ...

  5. ios UITapGestureRecognizer Single click 、 One finger multiple hits 、 Multi finger click 、 Multi click event operation

    from : stay ios In development , You need to do different things with your fingers , Take finger tapping as an example : Divided into single click . One finger multiple hits . Multi finger click ...

  6. solve IOS safari stay input focus Pop up input method does not support position fixed The problem of

    This article is a reprint of We're doing mobile web When applied , Often used to using position:fixed Put one input Box is fixed at the bottom of the page as a question or search box . But in IOS Of safari and webview in , Yes position ...

  7. map convert to list

    Java The code is as follows : package Test01; import java.util.ArrayList; import java.util.HashMap; import java.util.Ite ...

  8. (function(root,factory){})(this,function($){}) An anonymous function that executes immediately calls itself

    Because the new company uses ocx I started looking at the original code I found this by accident Maybe it was low Do you ( Although it's very difficult now low Well ) I didn't find this thing You can also write So I started to explore The complete code is as follows HTML <div id= ...

  9. NET Core Micro service road : Let's talk about consistency analysis in distributed systems

    Preface Uniformity : A lot of times it's in IT In the system , Usually in a distributed system , must ( Or finally ) Keep data consistent for multiple nodes . Everything in the world , There are the same characteristics or similarities , For example, the twins in childhood , A batch of factory assembly line products , Of course , We don't discuss non IT ...

  10. java.lang.IllegalStateException: Cannot forward after response has been committe

    Reference resources : add  return  Get it done