centos7下安装libiconv-1.14.tar.gz出错

在centos7下安装libiconv-1.14.tar.gz时遇到如下错误:./stdio.h:1010:1: error: ‘gets’ undeclared here (not in a function)

解决方法如下:
vi  srclib/stdio.h
找到
/* It is very rare that the developer ever has full control of stdin,
so any use of gets warrants an unconditional warning.  Assume it is
always declared, since it is required by C89.  */
_GL_WARN_ON_USE (gets, “gets is a security hole – use fgets instead”);
然后去掉:
_GL_WARN_ON_USE (gets, “gets is a security hole – use fgets instead”);
改成:
#if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16)
_GL_WARN_ON_USE (gets, “gets is a security hole – use fgets instead”);
#endif

然后重新make && make install,问题解决。

ubuntu 默认mysql 配置文件的位置

如果是通过apt-get安装

默认的配置文件是:/etc/mysql/my.cnf

打开之后,包含两段代码:

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/

查看之后发现

调用的是/etc/mysql/mysql.conf.d/mysqld bzga87u.cnf

这个是默认的配置信息,直接修改或者你可以写在my.cnf文件里面。

如果是自己安装,可以查看自己的安装目录