1,失血模型
2,贫血模型
3,充血模型
4,胀血模型
与传统三层架构的区别
1,失血模型
2,贫血模型
3,充血模型
4,胀血模型
与传统三层架构的区别
https://www.cnblogs.com/xuewenlong/p/12882047.html
[root@localhost ~]# rpm -qa | grep mariadb
mariadb-libs-5.5.60-1.el7_5.x86_64
[root@localhost ~]# yum erase -y mariadb-libs-5.5.60-1.el7_5.x86_64
tar -xf mysql-8.0.13-linux-glibc2.12-x86_64.tar.xz
mv mysql-8.0.13-linux-glibc2.12-x86_64 /usr/local/mysql
groupadd mysql
useradd -r -g mysql -s /sbin/nologin mysql
mkdir /data/mysql
mkdir /usr/local/mysql/etc
mkdir /usr/local/mysql/log
chown -R mysql:mysql /data/mysql/
chown -R mysql:mysql /usr/local/mysql/
vim /usr/local/mysql/etc/my.cnf
[mysql]
port = 3306
socket = /data/mysql/mysql.sock
[mysqld]
port = 3306
mysqlx_port = 33060
mysqlx_socket = /data/mysql/mysqlx.sock
basedir = /usr/local/mysql
datadir = /data/mysql
socket = /data/mysql/mysql.sock
pid-file = /data/mysql/mysqld.pid
log-error = /usr/local/mysql/log/error.log
#这个就是用之前的身份认证插件
default-authentication-plugin = mysql_native_password
#保证日志的时间正确
log_timestamps = SYSTEM
cd /usr/local/mysql
bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql
tail -f /usr/local/mysql/log/error.log
2019-01-13T20:27:49.270330+08:00 0 [System] [MY-013169] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.0.13) initializing of server in progress as process 6990
2019-01-13T20:27:53.320375+08:00 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: SV!sgk7?k0i=
2019-01-13T20:27:54.805257+08:00 0 [System] [MY-013170] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.0.13) initializing of server has completed
记住这个临时密码,后边要用到
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
/etc/init.d/mysqld start
Starting MySQL.. SUCCESS!
[root@localhost ~]# ps -ef | grep mysql
root 7072 1 0 20:30 pts/0 00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/mysqld.pid
mysql 7287 7072 7 20:30 pts/0 00:00:01 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/log/error.log --pid-file=/usr/local/mysql/data/mysqld.pid --socket=/usr/local/mysql/data/mysql.sock --port=3306
root 7334 6821 0 20:30 pts/0 00:00:00 grep --color=auto mysql
配置环境变量
vim /etc/profile
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin
source /etc/profile
[root@localhost ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.13
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
#这里就是重置临时密码
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '123456!';
Query OK, 0 rows affected (0.02 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.01 sec)
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select host, user, authentication_string, plugin from user;
+-----------+------------------+------------------------------------------------------------------------+-----------------------+
| host | user | authentication_string | plugin |
+-----------+------------------+------------------------------------------------------------------------+-----------------------+
| localhost | mysql.infoschema | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | caching_sha2_password |
| localhost | mysql.session | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | caching_sha2_password |
| localhost | mysql.sys | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | caching_sha2_password |
| localhost | root | *611725B3AA4055897CDB648E55E0A0EA856389E2 | mysql_native_password |
+-----------+------------------+------------------------------------------------------------------------+-----------------------+
4 rows in set (0.00 sec)
#这里就可以看到root@localhost这里的密码已经是mysql_native_password方式了
#这就是创建一个远程用户登录
mysql> create user 'root'@'%' identified by '123456!';
Query OK, 0 rows affected (0.05 sec)
mysql> grant all privileges on *.* to 'root'@'%' with grant option;
Query OK, 0 rows affected (0.04 sec)
mysql> select host, user, authentication_string, plugin from user;
+-----------+------------------+------------------------------------------------------------------------+-----------------------+
| host | user | authentication_string | plugin |
+-----------+------------------+------------------------------------------------------------------------+-----------------------+
| % | root | *43CAAB27D90B4E33EC75DEEFA02577F7E2BACE93 | mysql_native_password |
| localhost | mysql.infoschema | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | caching_sha2_password |
| localhost | mysql.session | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | caching_sha2_password |
| localhost | mysql.sys | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | caching_sha2_password |
| localhost | root | *611725B3AA4055897CDB648E55E0A0EA856389E2 | mysql_native_password |
+-----------+------------------+------------------------------------------------------------------------+-----------------------+
5 rows in set (0.00 sec)
mysql> exit
Bye
https://www.cnblogs.com/zhangkanghui/p/9613844.html
####(1)配置环境变量
变量名:MYSQL_HOME
变量值:E:\mysql-5.7.20-winx64
以管理员身份运行cmd
进入E:\python\mysql\mysql-8.0.12-winx64\bin>下
执行命令:mysqld –initialize-insecure –user=mysql
继续执行命令:mysqld -install
继续执行命令:net start MySQL
登录mysql:(因为之前没设置密码,所以密码为空,不用输入密码,直接回车即可)
E:\python\mysql\mysql-8.0.12-winx64\bin>mysql -u root -p
查询用户密码命令:mysql> select host,user,authentication_string from mysql.user;
mysql> update mysql.user set password=password(“123456″) where user=”root”;
mysql> flush privileges;
复制解压目录下的my-default.ini为my.ini,修改里面的文件
cmake3 参数说明boost路径使用自动下载时设置为1,不下载为0
cmake3 -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DWITH_DEBUG=OFF \
-DENABLED_PROFILING=ON \
-DWITH_EXTRA_CHARSETS=all \
-DWITH_INNOBASE_STORAGE_ENGINE=ON \
-DWITH_FEDERATED_STORAGE_ENGINE=ON \
-DWITH_ARCHIVE_STORAGE_ENGINE=ON \
-DWITH_EMBEDDED_SERVER=OFF \
-DWITH_BLACKHOLE_STORAGE_ENGINE=ON \
-DWITH_UNIT_TESTS=OFF \
-DENABLE_DTRACE=OFF \
-DFORCE_INSOURCE_BUILD=1 \
-DDOWNLOAD_BOOST=0 \
-DWITH_BOOST=/root/tools/mysql-8.0.20/boost/boost_1_70_0 \
-DMYSQL_DATADIR=/data/mysql
make && make install
还是太慢了,建议使用二进制安装
https://www.cnblogs.com/xuewenlong/p/12882047.html
yum -y install cmake3
//1.devtoolset + scl (推荐用这种方式)
yum install centos-release-scl -y
yum install devtoolset-7 -y
scl enable devtoolset-7 bash
gcc --version
scl enable devtoolset-7 bash #这样是创建了一个类似子shell的,在脚本里面不介意这样用,会有问题,如果在终端安装可以
#export CC=/opt/rh/devtoolset-7/root/usr/bin/gcc #脚本里可以这样定义GCC 的环境变量
#export CPP=/opt/rh/devtoolset-7/root/usr/bin/cpp
#export CXX=/opt/rh/devtoolset-7/root/usr/bin/c++
#source /opt/rh/devtoolset-7/enable or source scl_source enable devtoolset-7
ln -s /opt/rh/devtoolset-7/root/usr/bin/c++ /usr/bin/c++
"-DFORCE_INSOURCE_BUILD=1"