1. 程式人生 > 其它 >Mybatis-plus<三> MybatisPlus條件構造器

Mybatis-plus<三> MybatisPlus條件構造器

環境準備

虛擬機器安裝CentOS

下載並安裝xshell、xftp

下載MySQL

安裝MySQL命令

檢視系統中有無MySQL

  rpm -qa|grep mysql

檢視系統中有無mariadb

  rpm -qa | grep mariadb

解除安裝mariadb

  rpm -e --nodeps mariadb-libs-5.5.68-1.el7.x86_64

進入/usr/local/目錄

  cd /usr/local/

檢視目錄下內容

  ll

建立mysql目錄

  mkdir mysql

進入mysql目錄

  cd mysql

解壓mysql

  tar -xvf mysql-8.0.26-1.el7.x86_64.rpm-bundle.tar

檢視目錄下內容

  ll

mysql-8.0.26-1.el7.x86_64.rpm-bundle.tar
mysql-community-client-8.0.26-1.el7.x86_64.rpm
mysql-community-client-plugins-8.0.26-1.el7.x86_64.rpm
mysql-community-common-8.0.26-1.el7.x86_64.rpm
mysql-community-devel-8.0.26-1.el7.x86_64.rpm
mysql-community-embedded-compat-8.0.26-1.el7.x86_64.rpm
mysql
-community-libs-8.0.26-1.el7.x86_64.rpm mysql-community-libs-compat-8.0.26-1.el7.x86_64.rpm mysql-community-server-8.0.26-1.el7.x86_64.rpm mysql-community-test-8.0.26-1.el7.x86_64.rpm

依次安裝

  rpm -ivh mysql-community-common-8.0.26-1.el7.x86_64.rpm

  rpm -ivh mysql-community-client-plugins-8.0.26-1.el7.x86_64.rpm

  rpm -ivh mysql-community-libs-8.0.26-1.el7.x86_64.rpm

  rpm -ivh mysql-community-libs-compat-8.0.26-1.el7.x86_64.rpm

  rpm -ivh mysql-community-client-8.0.26-1.el7.x86_64.rpm

  rpm -ivh mysql-community-server-8.0.26-1.el7.x86_64.rpm

安裝完成後要初始化資料庫

  mysqld --initialize --console

  chown -R mysql:mysql /var/lib/mysql/

啟動mysql

  systemctl start mysqld

檢視初始密碼

  cat /var/log/mysqld.log | grep password

登入進資料庫

  mysql -u root -p

修改密碼

  ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';

  ALTER USER 'root'@'localhost' IDENTIFIED BY 'root' PASSWORD EXPIRE NEVER; 命令修改加密規則,MySql8.0 版本 和 5.0 的加密規則不一樣,而現在的視覺化工具只支援舊的加密方式。

通過以下命令,進行遠端訪問的授權

  create user 'root'@'%' identified with mysql_native_password by 'root';

  grant all privileges on *.* to 'root'@'%' with grant option;

  命令重新整理修該後的許可權

    flush privileges;

通過以下命令,關閉 firewall(防火牆)

  systemctl stop firewalld.service;

  systemctl disable firewalld.service;

  systemctl mask firewalld.service;

退出 MySQL命令

  exit;

  快捷方式

    CTRL+D