• centos 安装mysql5.7


    1.安装mysql5.7

    1. wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-boost-5.7.29.tar.gz 
    #从mysql官网找官方链接,mysql5.7版本有带boost的和不带boost的,这里以带boost为例,不带boost的需要自己安装boost
    2. tar zxf mysql-boost-5.7.29.tar.gz  
    #如果tar报错 尝试file mysql-boost-5.7.29.tar.gz 如果是html文件,是ping不通dev.mysql.com域名的原因,建议在windows下载再拉。
    3. cd mysql-boost-5.7.29
    #进入解压目录
    4. cmake  -DWITH_BOOST=boost
    #如果是带boost的mysql版本 直接填boost,如果是不带boost的版本应该要填boost的路径
    5. make && make install
     

    2.初始化mysql5.7

    1. groupadd apps   
    #增加用户组
    2. useradd -r -g apps -s /bin/false apps   
    #给apps用户组增加用户apps,跟my.cnf中的user一致
    3. ./bin/mysqld --defaults-file=/etc/my.cnf --initialize     
    #执行 mysql初始化命令,tips:在mysql5.7版本以前一般用mysql_install_db来初始化
    4. ./bin/mysqld_safe start (常见错误请看第5点)
    5. 可以直接启动mysql,mysql 第一次启动会自动初始化,当直接启动报错时就按这个来

     初始化后,data目录会生成以下文件

            auto.cnf :记录新生成的uuid

            ib_buffer_pool:记录Innodb缓冲池缓存的页面

            ibdata1:double write buffer

            ib_logfile0:redo log 日志文件

            ib_logfile1:redo log 日志文件

            ib_logfile2:redo log 日志文件

            ib_logfile3:redo log 日志文件

            mysql目录:存放mysql数据库的数据,如.frm和.idb文件

            performance_schema目录:存放performance_schema数据库的数据,如.frm和.idb文件

            sys目录:存放sys数据库的数据,如.frm和.idb文件

     

    3.启动 

    mysql启动单实例一般有两种方式,分别通过bin目录的mysqld_safe 和mysqld启动。

    mysqld是服务,而mysqld_safe是脚本命令。

    当我们通过./bin/mysqld start时,会直接启动mysql服务

    而用mysqld_safe启动时, 除了启动mysqld服务以外,还会启动一个守护进程来监控mysql实例的运行情况,在mysqld进程挂掉的时候重新启动mysqld(当然也有无法重启的时候)。用mysqld_safe会更安全一点。当然直接用support_files目录下的mysql.server来启动也是可以的(./mysql.server start),mysql-server也是通过mysql_safe来启动。mysqld在启动mysql实例的过程中调用load_defaults()找到配置文件并从中解析参数,mysql配置文件有一个读取顺序,在load_defaults函数中也定义了配置文件的读取顺序

    可以通过mysqld --verbose --help|grep -A 1 'Default options'命令进行查看

    mysql5.7读取配置文件的顺序是/etc/my.cnf >> /etc/mysql/my.cnf  >> /usr/local/mysql/etc/my.cnf  >> ~/.my.cnf 。

    当/etc/my.cnf , /etc/mysql/my.cnf , /usr/local/mysql/etc/my.cnf  , ~/.my.cnf中有多个位置存在cnf的情况下,会按优先级顺序依次读取配置文件,就是优先级低的配置参数会覆盖优先级高的参数,简单来说,有多个配置的情况下,参数以读取优先级低的参数为准。如果指定配置文件启动的话则不会发生上述情况,如 ./bin/mysqld_safe --defaults-file=/ete/my.cnf,会单单读取指定的配置文件

    4.初始化常见错误

    在初始化前配置文件设置了--log-bin参数

    [Note] --initialize specifed on an existing data directory.
    mysqld: File '/usr/local/mysql57/log/mysql-bin.index' not found (Errcode: 2 - No such file or directory)
    [ERROR] Aborting

    意思是说在log目录下没有找到mysql-bin.index文件(binlog的索引文件),有两个选择,第一个在log目录下新建mysql-bin.index文件并(错误的做法)
          新建完mysql-bin.index文件完后再次执行mysql初始化命令:  ./bin/mysqld --defaults-file=my.cnf --initialize 
          会立刻输出错误信息: [ERROR] --initialize specified but the data directory has files in it. Aborting.  #意思是初始化的时候,数据存放目录必须为空,所以不能在初始化前在数据目录添加文件
     
    下面再来说下第二个选择 --- 在配置文件中把 log-bin相关信息先注释掉,再执行初始化命令
    	  再次执行mysql初始化命令 ./bin/mysqld --defaults-file=/etc/my.cnf --initialize   (先把数据存放目录清空,就是配置文件中的datadir指向的目录,不指定配置文件忽略--defaults-file)


    5.启动常见错误

    Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn exist
     
    #出现类似错误的时候,例如mysql.plugin等等意思就是初始表在datadir指向的目录中不存在,实际上就是数据库初始化失败,在初始化成功的时候会生成这些表。
     
    error: InnoDB: Cannot allocate xxxxxxxxx memory for the buffer pool
     
    #出现这个错误是内存+swap比mysql配置文件中设置的值低的原因,解决如下:
    # free -m 查看内存及swap大小
    # fallocate -l 2G /swapfile  ##不行就再大点
    # chmod 600 /swapfile   ##给swap文件设置权限
    # mkswap /swapfile   ##更改swap区域大小
    # free -m     ##可见swap区域增大了,问题解决

    6.

    6.分析初始化日志,启动日志,关闭日志

    初始化日志

    2020-03-04T12:49:12.727378Z 0 [Warning] The syntax '--log_warnings/-W' is deprecated and will be removed in a future release. Please use '--log_error_verbosity' instead.
    2020-03-04T12:49:12.727612Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
    2020-03-04T12:49:12.727664Z 0 [Note] Ignoring --secure-file-priv value as server is running with --initialize(-insecure) or --bootstrap.
    2020-03-04T12:49:12.727685Z 0 [Note] ./mysqld (mysqld 5.7.18-log) starting as process 21601 ...        
    ##在21601进程号启动mysqld服务
    2020-03-04T12:49:12.729539Z 0 [Note] --initialize specifed on an existing data directory.              
    ##初始化开始
    2020-03-04T12:49:12.730119Z 0 [Warning] You need to use --log-bin to make --log-slave-updates work.  
    2020-03-04T12:49:12.730159Z 0 [Warning] You need to use --log-bin to make --binlog-format work.        
    ###log-bin检测
    2020-03-04T12:49:12.733912Z 0 [Warning] InnoDB: Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
    2020-03-04T12:49:12.733955Z 0 [Note] InnoDB: PUNCH HOLE support not available
    2020-03-04T12:49:12.733973Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
    2020-03-04T12:49:12.733985Z 0 [Note] InnoDB: Uses event mutexes
    2020-03-04T12:49:12.733996Z 0 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier
    2020-03-04T12:49:12.734007Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
    2020-03-04T12:49:12.734018Z 0 [Note] InnoDB: Using Linux native AIO
    2020-03-04T12:49:12.735557Z 0 [Note] InnoDB: Number of pools: 1
    2020-03-04T12:49:12.735705Z 0 [Note] InnoDB: Using CPU crc32 instructions
    2020-03-04T12:49:12.738118Z 0 [Note] InnoDB: Initializing buffer pool, total size = 1G, instances = 8, chunk size = 128M
    2020-03-04T12:49:12.807181Z 0 [Note] InnoDB: Completed initialization of buffer pool                    
    #初始化缓冲区
    2020-03-04T12:49:12.818875Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
    2020-03-04T12:49:12.828983Z 0 [Note] InnoDB: The first innodb_system data file 'ibdata1' did not exist. A new tablespace will be created!             
    2020-03-04T12:49:12.829374Z 0 [Note] InnoDB: Setting file '/usr/local/data/ibdata1' size to 10 MB. Physically writing the file full; Please wait ...
    2020-03-04T12:49:13.013697Z 0 [Note] InnoDB: File '/usr/local/data/ibdata1' size is now 10 MB.       
    ###设置新的系统表空间文件
    2020-03-04T12:49:13.014237Z 0 [Note] InnoDB: Setting log file /usr/local/data/ib_logfile101 size to 256 MB
    2020-03-04T12:49:13.014399Z 0 [Note] InnoDB: Progress in MB:
     100 200
    2020-03-04T12:49:18.474247Z 0 [Note] InnoDB: Setting log file /usr/local/data/ib_logfile1 size to 256 MB
    2020-03-04T12:49:18.474502Z 0 [Note] InnoDB: Progress in MB:
     100 200
    2020-03-04T12:49:24.409870Z 0 [Note] InnoDB: Setting log file /usr/local/data/ib_logfile2 size to 256 MB
    2020-03-04T12:49:24.410095Z 0 [Note] InnoDB: Progress in MB:
     100 200
    2020-03-04T12:49:29.865604Z 0 [Note] InnoDB: Setting log file /usr/local/data/ib_logfile3 size to 256 MB
    2020-03-04T12:49:29.865799Z 0 [Note] InnoDB: Progress in MB:
     100 200
    ###生成并设置redo log文件的大小
    2020-03-04T12:49:35.410426Z 0 [Note] InnoDB: Renaming log file /usr/local/data/ib_logfile101 to /usr/local/data/ib_logfile0
    2020-03-04T12:49:35.410505Z 0 [Warning] InnoDB: New log files created, LSN=45790
    2020-03-04T12:49:35.410527Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
    2020-03-04T12:49:35.410568Z 0 [Note] InnoDB: Setting file '/usr/local/data/ibtmp1' size to 16 MB. Physically writing the file full; Please wait ...
    2020-03-04T12:49:36.582287Z 0 [Note] InnoDB: File '/usr/local/data/ibtmp1' size is now 16 MB.
    ###为临时表生成并设置共享表空间的大小
    2020-03-04T12:49:36.582461Z 0 [Note] InnoDB: Doublewrite buffer not found: creating new
    2020-03-04T12:49:37.418817Z 0 [Note] InnoDB: Doublewrite buffer created
    ##创建Doublewrite缓冲区,解决partial page write问题
    ##InnoDB 的Page Size一般是16KB,其数据校验也是针对这16KB来计算的,将数据写入到磁盘是以Page为单位进行操作的。
    ##计算机硬件和操作系统,在极端情况下(比如断电)往往并不能保证这一操作的原子性,16K的数据,写入4K 时,发生了系统断电/os crash
    ##只有一部分写是成功的,这种情况下就是 partial page write 问题。 2020-03-04T12:49:38.099574Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active. 2020-03-04T12:49:38.099628Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active. 2020-03-04T12:49:38.101267Z 0 [Warning] InnoDB: Creating foreign key constraint system tables. 2020-03-04T12:49:38.128695Z 0 [Note] InnoDB: Foreign key constraint system tables created ##创建外键约束系统表 2020-03-04T12:49:38.128754Z 0 [Note] InnoDB: Creating tablespace and datafile system tables. 2020-03-04T12:49:38.132552Z 0 [Note] InnoDB: Tablespace and datafile system tables created. ##创建表空间 2020-03-04T12:49:38.132601Z 0 [Note] InnoDB: Creating sys_virtual system tables. 2020-03-04T12:49:38.135755Z 0 [Note] InnoDB: sys_virtual table created ##创建系统虚拟表 2020-03-04T12:49:38.135847Z 0 [Note] InnoDB: Waiting for purge to start 2020-03-04T12:49:38.185955Z 0 [Note] InnoDB: 5.7.18 started; log sequence number 0 2020-03-04T12:49:38.185959Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 25367ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.) 2020-03-04T12:49:38.187735Z 0 [Note] Plugin 'FEDERATED' is disabled. 2020-03-04T12:49:38.188267Z 0 [Note] Salting uuid generator variables, current_pid: 21601, server_start_time: 1583326152, bytes_sent: 0, 2020-03-04T12:49:38.200018Z 0 [Note] Generated uuid: '9ba82205-5e16-11ea-be81-fa163eb9fda0', server_start_time: 6080140973510228009, bytes_sent: 97931696 2020-03-04T12:49:38.200051Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 9ba82205-5e16-11ea-be81-fa163eb9fda0. ##生成uuid 2020-03-04T12:49:38.203492Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened. ##打开Gtid 2020-03-04T12:49:38.203852Z 1 [Note] Creating the system database 2020-03-04T12:49:38.204125Z 1 [Note] A temporary password is generated for root@localhost: jR;Ab.961Ef9 2020-03-04T12:49:38.204326Z 1 [Note] Creating the system tables ##创建系统表,生成root用户密码 2020-03-04T12:49:46.886495Z 1 [Note] Filling in the system tables, part 1 2020-03-04T12:49:46.888081Z 1 [Note] Filling in the system tables, part 2 2020-03-04T12:49:46.888108Z 1 [Note] Filling in the mysql.help table ##填充系统表数据 2020-03-04T12:49:48.735711Z 1 [Note] Creating the sys schema ##创建系统数据库 2020-03-04T12:49:48.736116Z 1 [Warning] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode. 2020-03-04T12:49:48.736149Z 1 [Warning] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode. 2020-03-04T12:49:48.736168Z 1 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode. 2020-03-04T12:49:48.736184Z 1 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode. 2020-03-04T12:49:48.736223Z 1 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode. ## 启动skip-name-resolve 模式 2020-03-04T12:49:53.017396Z 1 [Note] Bootstrapping complete ##初始化完成 2020-03-04T12:49:53.017725Z 0 [Note] Giving 0 client threads a chance to die gracefully 2020-03-04T12:49:53.017780Z 0 [Note] Shutting down slave threads #关闭线程 2020-03-04T12:49:53.017789Z 0 [Note] Forcefully disconnecting 0 remaining clients 2020-03-04T12:49:53.052400Z 0 [Note] Binlog end 2020-03-04T12:49:53.053138Z 0 [Note] InnoDB: FTS optimize thread exiting. 2020-03-04T12:49:53.053197Z 0 [Note] InnoDB: Starting shutdown... #开始关闭mysqld服务 2020-03-04T12:49:53.153419Z 0 [Note] InnoDB: Dumping buffer pool(s) to /mysql_dbdat/mysql57_data3308/ib_buffer_pool #把Innodb缓冲池缓存的页面记录到文件中 2020-03-04T12:49:53.153608Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 200304 20:49:53 ##记录InnoDB 缓冲池中缓存的页面 2020-03-04T12:49:54.993326Z 0 [Note] InnoDB: Shutdown completed; log sequence number 2536857 mysqld服务关闭完成 2020-03-04T12:49:54.993598Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1" #移除临时表空间

    启动日志

    2020-03-06T10:59:13.425732+08:00 0 [Warning] The syntax 'avoid_temporal_upgrade' is deprecated and will be removed in a future release
    2020-03-06T10:59:13.425840+08:00 0 [Warning] The syntax '--log_warnings/-W' is deprecated and will be removed in a future release. Please use '--log_error_verbosity' instead.
    ###不建议使用配置文件中的参数avoid_temporal_upgrade和log_warnings/-W
    2020-03-06T10:59:13.426035+08:00 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
    ##推荐使用explicit_defaults_for_timestamp
    2020-03-06T10:59:13.426047+08:00 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
    ##没有开启'NO_AUTO_CREATE_USER' SQL mode  -- 开启这个模式可以防止grant语句在没有identified by 的情况会自动创建账号,但会导致复制不安全
    2020-03-06T10:59:13.426082+08:00 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
    ##推荐设置配置文件中--secure-file-priv的值
    2020-03-06T10:59:13.426108+08:00 0 [Note] /usr/local/mysql57/bin/mysqld (mysqld 5.7.20-log) starting as process 26954 ...
    ##在26954进程号中启动mysql服务
    2020-03-06T10:59:13.465308+08:00 0 [Warning] InnoDB: Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
    ##提示不推荐使用配置文件的innodb_file_format,并可能在将来删除这个参数
    2020-03-06T10:59:13.465385+08:00 0 [Note] InnoDB: PUNCH HOLE support available
    2020-03-06T10:59:13.465412+08:00 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
    ##互斥锁和读写锁的内部结构是原子性的
    2020-03-06T10:59:13.465430+08:00 0 [Note] InnoDB: Uses event mutexes
    ##使用互斥锁
    2020-03-06T10:59:13.465447+08:00 0 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier
    ##启用GCC bulitin __sync_synchronize()  ---这个函数在C代码编译的时候可以要求CPU必须要指定顺序编译
    2020-03-06T10:59:13.465463+08:00 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
    ##表数据的压缩使用zlib 1.2.3
    2020-03-06T10:59:13.465478+08:00 0 [Note] InnoDB: Using Linux native AIO
    ###使用非阻塞异步的方式读取磁盘文件
    2020-03-06T10:59:13.471496+08:00 0 [Note] InnoDB: Number of pools: 1
    2020-03-06T10:59:13.474731+08:00 0 [Note] InnoDB: Using CPU crc32 instructions
    使用CRC32的cpu架构
    2020-03-06T10:59:13.477776+08:00 0 [Note] InnoDB: Initializing buffer pool, total size = 16G, instances = 16, chunk size = 128M
    2020-03-06T10:59:14.753929+08:00 0 [Note] InnoDB: Completed initialization of buffer pool
    ##初始化缓冲池
    2020-03-06T10:59:14.950630+08:00 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
    ###提示执行用户被权限的情况下page cleaner线程的优先级可以改
    2020-03-06T10:59:14.981735+08:00 0 [Note] InnoDB: Highest supported file format is Barracuda.
    ###配置文件innodb_file_format=Barracuda
    2020-03-06T10:59:15.094450+08:00 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 2574939
    ###redo日志扫描通过日志序列号2574939---这个位置为checkpoint点(redo日志以该checkpoint点为分割,前面的已经刷新到磁盘上,)
    2020-03-06T10:59:15.094520+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 2574948
    ###redo日志扫描到序列号为2574948的位置上
    2020-03-06T10:59:15.094540+08:00 0 [Note] InnoDB: Database was not shutdown normally!
    2020-03-06T10:59:15.094556+08:00 0 [Note] InnoDB: Starting crash recovery.
    ###开始宕机恢复
    2020-03-06T10:59:15.418584+08:00 0 [Note] InnoDB: Last MySQL binlog file position 0 1116, file name mysql-bin.000003
    ###最新的binlog位置在mysql-bin.000003文件的1116位置
    2020-03-06T10:59:15.643155+08:00 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
    ###移除临时表空间文件ibtmp1
    2020-03-06T10:59:15.643213+08:00 0 [Note] InnoDB: Creating shared tablespace for temporary tables
    ###为临时表创建共享表空间
    2020-03-06T10:59:15.643282+08:00 0 [Note] InnoDB: Setting file '/usr/local/data/ibtmp1' size to 100 MB. Physically writing the file full; Please wait ...
    2020-03-06T10:59:15.643833+08:00 0 [Note] InnoDB: Progress in MB:
     100
    2020-03-06T10:59:15.704023+08:00 0 [Note] InnoDB: File '/usr/local/data/ibtmp1' size is now 100 MB.
    ###重新设置临时表空间文件并设置大小为100MB
    2020-03-06T10:59:15.704926+08:00 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
    2020-03-06T10:59:15.704958+08:00 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
    ###有96共回滚段,32个非回滚段 
    2020-03-06T10:59:15.705207+08:00 0 [Note] InnoDB: Waiting for purge to start
    ###等待purge启动----purge(purge主要是删除数据库中被标记为del的数据清除,因为在执行delete操作后,并不会立刻删除记录,而是把记录标记为del)
    2020-03-06T10:59:16.004769+08:00 0 [Note] InnoDB: 5.7.20 started; log sequence number 2574948
    ###redo log从日志标志位为2574948开始记录
    2020-03-06T10:59:16.005442+08:00 0 [Note] InnoDB: Loading buffer pool(s) from /usr/local/data/ib_buffer_pool
    ###加载上次运行时缓冲池的数据
    2020-03-06T10:59:16.005751+08:00 0 [Note] Plugin 'FEDERATED' is disabled.
    ###
    20-03-06T10:59:16.026994+08:00 0 [Note] Recovering after a crash using /usr/local/data/log/mysql-bin
    2020-03-06T10:59:16.027049+08:00 0 [Note] Starting crash recovery...
    2020-03-06T10:59:16.027084+08:00 0 [Note] Crash recovery finished.
    ###又宕机恢复
    2020-03-06T10:59:16.048594+08:00 0 [Note] InnoDB: Buffer pool(s) load completed at 200306 10:59:16
    ###上次运行时的缓冲池信息加载完成
    2020-03-06T10:59:16.069804+08:00 0 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
    2020-03-06T10:59:16.069899+08:00 0 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
    2020-03-06T10:59:16.069926+08:00 0 [Note] Server socket created on IP: '0.0.0.0'.
    ###表示可以通过任何ip连接mysql 通过配置文件bind-address设置
    2020-03-06T10:59:16.084593+08:00 0 [Warning] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.
    2020-03-06T10:59:16.084648+08:00 0 [Warning] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode.
    2020-03-06T10:59:16.084672+08:00 0 [Warning] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.
    2020-03-06T10:59:16.084692+08:00 0 [Warning] 'user' entry 'dba@localhost' ignored in --skip-name-resolve mode.
    2020-03-06T10:59:16.084712+08:00 0 [Warning] 'user' entry 'jiankongbao@localhost' ignored in --skip-name-resolve mode.
    2020-03-06T10:59:16.084915+08:00 0 [Warning] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode.
    2020-03-06T10:59:16.084937+08:00 0 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
    2020-03-06T10:59:16.085119+08:00 0 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
    2020-03-06T10:59:16.119375+08:00 0 [Warning] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode.
    2020-03-06T10:59:16.119416+08:00 0 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
    ### 启动skip-name-resolve 模式,上述账号失效
    2020-03-06T10:59:16.197216+08:00 0 [Note] Event Scheduler: Loaded 0 events
    2020-03-06T10:59:16.197398+08:00 1 [Note] Event Scheduler: scheduler thread started with id 1
    ##事件调度器加载事件 --EVENT Scheduler类似定时任务crontab
    2020-03-06T10:59:16.197537+08:00 0 [Note] /apps/svr/mysql57/bin/mysqld: ready for connections.
    ###提示可以通过客户端进行连接
    Version: '5.7.20-log'  socket: '/tmp/mysql3306.sock'  port: 3306  MySQL Community Server (GPL)
    ###mysql服务启动信息
    2020-03-06T10:59:16.197573+08:00 0 [Note] Executing 'SELECT * FROM INFORMATION_SCHEMA.TABLES;' to get a list of tables using the deprecated partition engine. You may use the startup option '--disable-partition-engine-check' to skip this check. 
    ##查询使用不推荐分区的表,配置文件中的参数disable-partition-engine-check可以关闭这个检查
    20-03-06T10:59:16.197589+08:00 0 [Note] Beginning of list of non-natively partitioned tables
    2020-03-06T10:59:16.307750+08:00 0 [Note] End of list of non-natively partitioned tables
    

    关闭日志

    2020-03-06T13:22:14.430129+08:00 0 [Note] Giving 1 client threads a chance to die gracefully
    ###让客户端自己断开连接
    2020-03-06T13:22:14.430196+08:00 0 [Note] Shutting down slave threads
    ###关闭slave线程
    2020-03-06T13:22:16.430294+08:00 0 [Note] Forcefully disconnecting 1 remaining clients
    ###强制断开1个仍然存在的client连接
    2020-03-06T13:22:16.430361+08:00 0 [Note] Event Scheduler: Killing the scheduler thread, thread id 1
    2020-03-06T13:22:16.430374+08:00 0 [Note] Event Scheduler: Waiting for the scheduler thread to reply
    2020-03-06T13:22:16.430485+08:00 0 [Note] Event Scheduler: Stopped
    2020-03-06T13:22:16.430499+08:00 0 [Note] Event Scheduler: Purging the queue. 0 events
    ###关闭事件调度器EVENT Scheduler
    2020-03-06T13:22:16.430657+08:00 0 [Note] Binlog end
    ###binlog日志记录结束
    2020-03-06T13:22:16.433264+08:00 0 [Note] Shutting down plugin 'ngram'
    2020-03-06T13:22:16.433286+08:00 0 [Note] Shutting down plugin 'BLACKHOLE'
    2020-03-06T13:22:16.433294+08:00 0 [Note] Shutting down plugin 'partition'
    2020-03-06T13:22:16.433299+08:00 0 [Note] Shutting down plugin 'ARCHIVE'
    2020-03-06T13:22:16.433304+08:00 0 [Note] Shutting down plugin 'MyISAM'
    2020-03-06T13:22:16.433316+08:00 0 [Note] Shutting down plugin 'CSV'
    2020-03-06T13:22:16.433329+08:00 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
    2020-03-06T13:22:16.433336+08:00 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
    2020-03-06T13:22:16.433341+08:00 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
    2020-03-06T13:22:16.433346+08:00 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
    2020-03-06T13:22:16.433351+08:00 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
    2020-03-06T13:22:16.433355+08:00 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
    2020-03-06T13:22:16.433360+08:00 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
    2020-03-06T13:22:16.433365+08:00 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
    2020-03-06T13:22:16.433370+08:00 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
    2020-03-06T13:22:16.433374+08:00 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
    2020-03-06T13:22:16.433379+08:00 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
    2020-03-06T13:22:16.433384+08:00 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
    2020-03-06T13:22:16.433389+08:00 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
    2020-03-06T13:22:16.433393+08:00 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
    2020-03-06T13:22:16.433398+08:00 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
    2020-03-06T13:22:16.433403+08:00 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
    2020-03-06T13:22:16.433408+08:00 0 [Note] Shutting down plugin 'INNODB_METRICS'
    2020-03-06T13:22:16.433412+08:00 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
    2020-03-06T13:22:16.433417+08:00 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
    2020-03-06T13:22:16.433422+08:00 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
    2020-03-06T13:22:16.433426+08:00 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
    2020-03-06T13:22:16.433431+08:00 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
    2020-03-06T13:22:16.433436+08:00 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
    2020-03-06T13:22:16.433440+08:00 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
    2020-03-06T13:22:16.433445+08:00 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
    2020-03-06T13:22:16.433449+08:00 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
    2020-03-06T13:22:16.433454+08:00 0 [Note] Shutting down plugin 'INNODB_CMP'
    2020-03-06T13:22:16.433469+08:00 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
    2020-03-06T13:22:16.433474+08:00 0 [Note] Shutting down plugin 'INNODB_LOCKS'
    2020-03-06T13:22:16.433478+08:00 0 [Note] Shutting down plugin 'INNODB_TRX'
    2020-03-06T13:22:16.433482+08:00 0 [Note] Shutting down plugin 'InnoDB'
    ###关闭正在使用的插件
    2020-03-06T13:22:16.433559+08:00 0 [Note] InnoDB: FTS optimize thread exiting.
    ##FTS优化器线程存在
    2020-03-06T13:22:16.433990+08:00 0 [Note] InnoDB: Starting shutdown...
    ###mysql服务开始关闭
    2020-03-06T13:22:16.534164+08:00 0 [Note] InnoDB: Dumping buffer pool(s) to /usr/local/data/ib_buffer_pool
    2020-03-06T13:22:16.534502+08:00 0 [Note] InnoDB: Buffer pool(s) dump completed at 200306 13:22:16
    ###把缓冲池数据写到磁盘文件/usr/local/data/ib_buffer_pool
    2020-03-06T13:22:17.867771+08:00 0 [Note] InnoDB: Shutdown completed; log sequence number 2579005
    ###关闭mysql服务成功,当前日志标志位为2579005
    2020-03-06T13:22:17.868954+08:00 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
    ###移除临时表空间文件ibtmp1
    2020-03-06T13:22:17.868980+08:00 0 [Note] Shutting down plugin 'MEMORY'
    2020-03-06T13:22:17.868990+08:00 0 [Note] Shutting down plugin 'MRG_MYISAM'
    2020-03-06T13:22:17.869006+08:00 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
    2020-03-06T13:22:17.869035+08:00 0 [Note] Shutting down plugin 'sha256_password'
    2020-03-06T13:22:17.869045+08:00 0 [Note] Shutting down plugin 'mysql_native_password'
    2020-03-06T13:22:17.869193+08:00 0 [Note] Shutting down plugin 'binlog'
    ###关闭上述插件
    2020-03-06T13:22:17.870065+08:00 0 [Note] /apps/svr/mysql57/bin/mysqld: Shutdown complete
    ###关闭完成
  • 相关阅读:
    JavaScript 变量类型 保存内存中的位置 和 引用
    https连接过程
    微信消息自动回复 json版
    RabbitMQ安装
    nginx反向代理
    小程序接口记录
    nginx同服务器不同目录的差别配置
    nginx URL隐藏index.php
    Laravel 打印SQL语句
    laravel PostTooLargeException
  • 原文地址:https://www.cnblogs.com/start-from-zero/p/12582305.html
Copyright © 2020-2023  润新知