Mysql5.7.19安装后错误日志中有警告

警告1:

secure_file_priv 配置项对数据导入导出的影响mysql

一、限制mysqld 不容许导入 | 导出web

 mysqld --secure_file_prive=null
MySQL [ztjy]> select * from info_posts limit 10 into outfile '/usr/local/src/info_posts_tmp.txt'; 
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement.

二、限制mysqld 的导入 | 导出 只能发生在/tmp/目录下sql

mysqld --secure_file_priv=/tmp/

三、不对mysqld 的导入 | 导出作限制数据库

cat /etc/my.cnf
    [mysqld]
    secure_file_priv

说明:
例如咱们能够经过 select * from tempdb.t into outfile '/home/mysql/t.txt'; 把tempdb.t 表的数据导出来;这个导出操做能够面临以下问题
一、任何一个mysql用户只要它能执行上面的sql语句、而且执行成功;那么它就把文件写到了/home/mysql/目录下?
 若是有一个坏人他一直导出数据到文件目录,那么总有一天会被写满的!
二、没有办法限制只能把文件导出到/tmp/目录
这个不会影响mysqldump使用,放心好了。服务器

警告2:

[Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key

在5.7中,经过ssl方式链接mysql被做为默认和推荐。若是你并不须要(好比web端和db端同一台服务器,db服务器处于web端内网等),就能够不用使用ssl方式。
干掉警告很简单,只要在my.cnf声明跳过ssl就好了。网络

skip-ssl

如此便OK了。session

警告3:

2017-09-11T10:31:08.542031Z 0 [Warning] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode.
2017-09-11T10:31:08.542053Z 0 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
2017-09-11T10:31:08.542101Z 0 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
2017-09-11T10:31:08.543552Z 0 [Warning] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode.
2017-09-11T10:31:08.543589Z 0 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
skip-name-resolve

禁止MySQL对外部链接进行DNS解析,使用这一选项能够消除MySQL进行DNS解析的时间。但须要注意,若是开启该选项, 则全部远程主机链接受权都要使用IP地址方式,不然MySQL将没法正常处理链接请求。wordpress

若是必定要使用参数,这个真心无解,在5.6中压根不会报localhost的错。
若是你不喜欢这个提示,只能说,不要使用skip-name-resolve参数。
还要即使你有心去把localhost修改成127.0.0.1,不少应用,好比wordpress这些默认访问localhost的应用,都会不可用,须要更改host为127.0.0.1才行。post

要是你没有远程访问数据库的话,只是在本地使用数据库,推荐你用skip-networking而不是skip-name-resolve。skip-name-resolve参数它的功能主要是禁用DNS解析的,这样能够加快数据库的反应时间,而skip-networking参数是设置MySQL不要监听网络,也就只能本机访问。this

MySQL [mysql]> select * from db where host='localhost'\G
MySQL [mysql]> select * from proxies_priv where host='localhost'\G
MySQL [mysql]> select * from tables_priv where host='localhost'\G

以上3个语句能够查看到上面的几个用户

Note:4.

[Note] Executing 'SELECT * FROM INFORMATION_SCHEMA.TABLES;' to get a list of ta
bles using the deprecated partition engine. You may use the startup option '--disable-partition-engine-check' to s
kip this check. 
2017-09-13T15:30:05.665352+08:00 0 [Note] Beginning of list of non-natively partitioned tables
2017-09-13T15:30:05.863507+08:00 0 [Note] End of list of non-natively partitioned tables

修改配置my.cnf文件,加上

disable-partition-engine-check=1

说明:

启动的时候会进行check表,可能会拖慢启动的速度

相关文章
相关标签/搜索