zoukankan      html  css  js  c++  java
  • centos下编译安装mysql5.5/5.6/5.7

    2018-12-28 14:38:46 星期五

    centos 系统在mysql官网, 按照教程去配置yum源, 然后安装, 不用自己找依赖了: 

    https://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/

    注: 下载链接中包含 el6 表示适合centos 6, el7表示适合centos 7

    -------------------------------------------------------------------------------------------------

    2013年11月16日 19:39:13

    centos 6 mysql 5.5.28

    我只说些我出错的地方:

    cmake后删除的方法是 xargs rm < install_manifest.text

    注意这个命令只会删除安装目录中的文件,而不会删除安装目录中的文件夹

    --------------------------------

    假如你安装的basedir是/usr/local/mysql

    那么就粗犷的执行下 chown -R mysql.mysql /usr/local/mysql 保证所有的程序都可以被mysql这个用户执行

    (数据库的数据目录,权限须设为你的mysql的系统管理用户,不能是root,一般默认是名为mysql用户)

    否则执行 service mysqld start 时提示 The server quit without updating PID file 这样的错误

    此时查看error.log里边显示的是 Can't start server : Bind on unix socket: Permission denied

    ----------------------------------------

     安装的时候可以只

    cmake -DCMAKE_INSTALL_PREFIX=/******

    不写其它的配置参数

    安装好后再安装目录里找到配置文件自己修改相关项就行了

    参考链接:

    http://www.360doc.com/content/12/0304/19/2054285_191664568.shtml 

    http://blog.csdn.net/zqtsx/article/details/9378703 

    http://www.cnblogs.com/xiongpq/p/3384681.html

    ----------------------------------------

    2014年2月15日 21:33:40

    yum -y install cmake
    yum -y install gcc-c++ //缺少会提示, ***_CXX_COMPLIER....缺失
    yum -y install ncurses ncurses-devel //缺少时,会提示此软件的名字,复制它们再yum安装就行了
    
    如果安装过程中失败,提示缺少其他软件,安装依赖的软件后先执行:
    rm CMakeCache.txt 然后再 cmake ....
    cmake -DCMAKE_INSTALL_PREFIX=/usr/local/web/mysql -DEXTRA_CHARSETS=all -DDEFAULT_CHARSETS=utf8 -DDERAULT_COLLATION=utf8_general_ci

     执行 script/myslq_install_db --basedir=.... --datadiar=.... 后,提示怎样去设置密码以及怎样设置随系统启动

    To start mysqld at boot time you have to copy
    support-files/mysql.server to the right place for your system
    
    PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
    To do so, start the server, then issue the following commands:
    
      /usr/local/web/mysql/bin/mysqladmin -u root password 'new-password'
      /usr/local/web/mysql/bin/mysqladmin -u root -h AY1402041644126082e5Z password 'new-password'

    怎样启动MYSQL以及怎样测试MYSQL

    You can start the MySQL daemon with:
    
      cd . ; /usr/local/web/mysql/bin/mysqld_safe &
    
    You can test the MySQL daemon with mysql-test-run.pl
    
      cd mysql-test ; perl mysql-test-run.pl

    另外,我在执行这段安装数据库的脚本前,就已经将my-default.cnf复制到安装根目录下边并重命名为my.cnf,这时程序提示

    WARNING: Found existing config file /usr/local/web/mysql/my.cnf on the system.
    Because this file might be in use, it was not replaced,
    but was used in bootstrap (unless you used --defaults-file)
    and when you later start the server.
    The new default config file was created as /usr/local/web/mysql/my-new.cnf,
    please compare it with your file and take the changes you need

    其实,该脚本程序创建的my-new.cnf和my-default.cnf的内容是一样的:基本上没有什么内容

    在安装完成mysql,以及初始化数据库,修改用户组,安装service服务后,先不要启用新版本的my.cnf里的socket指令,否则执行mysql命令时总是提示

    Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

    即使修改配置文件socket文件位置,重启MYSQL服务也没有(暂时还不知道为什么)

    --------------------------

    cmake的重要特性之一是其独立于源码(out-of-source)的编译功能,即编译工作可以在另一个指定的目录中而非源码目录中进行,这可以保证源码目录不受任何一次编译的影响,因此在同一个源码树上可以进行多次不同的编译,如针对于不同平台编译(http://www.linuxidc.com/Linux/2013-08/88664.htm)

     --------------------------------------------------------------------

    2018-12-28 11:27:26 星期五

    centos 6.1 安装 mysql 5.7

     5.7 以后由于mysql依赖了 boost 库, 所以必须先安装boost库, 并且在 configure时指定boost的安装目录 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/usr/local/boost

    参考: http://www.cnblogs.com/galengao/p/5755788.html

    安装时遇到 error while loading shared libraries: libatomic.so.1

     这样解决: yum install -y libatomic 

    安装5.7.24 rpm包

    遇到:  libnuma.so.1()(64bit) is needed by mysql.....

    这样解决:  yum install -y numactl  yum install -y numactl-devel

     安装好以后, 先初始化, 初始化后会生成密码, 但是密码在日志中, 

    命令 rpm -ql mysql.....server....el6....  可以看到安装的mysql都到了哪些目录中, 查看 /etc/my.cnf 找到日志存放的路径,

    打开日志 grep password 找到初始密码, 启动服务, 登录, 重新修改密码: set password='Xm123456@'; 再重新登录

    参考: https://www.jianshu.com/p/be16598e6ce5

  • 相关阅读:
    1144 The Missing Number (20分)
    1145 Hashing
    1146 Topological Order (25分)
    1147 Heaps (30分)
    1148 Werewolf
    1149 Dangerous Goods Packaging (25分)
    TypeReference
    Supervisor安装与配置()二
    谷粒商城ES调用(十九)
    Found interface org.elasticsearch.common.bytes.BytesReference, but class was expected
  • 原文地址:https://www.cnblogs.com/iLoveMyD/p/3427136.html
Copyright © 2011-2022 走看看