手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

Linux 下 MySQL 5.5.8 源码编译安装记录

[日期:2011-01-16] 来源:Linux社区  作者:cloudline [字体:大 中 小]

6. bison

    ----shell:~$ sudo apt-get install bison

    ----可选。没有这个工具,在make的时候报出警告。

    ----警告记录:

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

          Warning: Bison executables not found in PATH

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

7.chkconfig

    ----后面配置MySQL服务自启动的时候需要。

    ----shell:~$ sudo apt-get install chkconfig

=>mysql安装:

1.解压源代码文件

    ----shell定位到源代码文件所在目录

    ----解压

         shell:~$ tar zxvf mysql-5.5.8.tar.gz
2.cmake操作

    ----shell定位到解压出的源代码文件夹目录(文件夹:mysql-5.5.8)
    ----cmake执行:

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

         shell:~$ cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql

                                     -DMYSQL_DATADIR=/home/system_username/Programming/mysql/mysqldata                

                                     -DSYSCONFDIR=/etc                                               

                                     -DWITH_INNOBASE_STORAGE_ENGINE=1

                                     -DWITH_ARCHIVE_STORAGE_ENGINE=1

                                     -DWITH_BLACKHOLE_STORAGE_ENGINE=1 

                                     -DWITH_FEDERATED_STORAGE_ENGINE=1

                                     -DWITH_PARTITION_STORAGE_ENGINE=1

                                     -DMYSQL_UNIX_ADDR=/tmp/mysqld.sock

                                     -DMYSQL_TCP_PORT=3306

                                     -DENABLED_LOCAL_INFILE=1

                                     -DEXTRA_CHARSETS=all

                                     -DDEFAULT_CHARSET=utf8

                                     -DDEFAULT_COLLATION=utf8-general_ci

                                     -DMYSQL_USER=mysql

        注:没有换行。官方文档上,cmake 命令后面加个点不懂什么意思。在这里加上命令执行不了

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

        源代码配置选项说明:

                     //mysql安装的主目录,5.5.8版本默认为/usr/local/mysql,所以可以不添加

                     -DCMAKE_INSTALL_PREFIX=/usr/local/mysql

 

                     //mysql数据保存的路径,自定义

                     -DMYSQL_DATADIR=/home/system_username/mysql/mysqldata  

 

                     //mysql配置文件地址------The default my.cnf option file directory

                     -DSYSCONFDIR=/etc

 

                     //Compile storage engine xxx statically into server

                     /*Storage engines are built as plugins. You can build a plugin as a static module (compiled into the server)    

                      *or a dynamic module  (built as a dynamic library that must be installed into the server using the INSTALL  

                      *PLUGIN statement or the --plugin-load option before it can be used). Some plugins might not support static 

                      *or dynamic building.

                      */

                     -DWITH_INNOBASE_STORAGE_ENGINE=1

                     -DWITH_ARCHIVE_STORAGE_ENGINE=1

                     -DWITH_BLACKHOLE_STORAGE_ENGINE=1

                     -DWITH_FEDERATED_STORAGE_ENGINE=1

                     -DWITH_PARTITION_STORAGE_ENGINE=1

 

                     //Unix socket file

                     /*

                      *The Unix socket file path on which the server listens for socket connections. This must be an absolute path 

                      *name. The default is /tmp/mysql.sock

                      */

                     -DMYSQL_UNIX_ADDR=/tmp/mysqld.sock

 

                     //数据库服务器TCP/IP连接的监听端口,默认为3306

                     -DMYSQL_TCP_PORT=3306

 

                     //Whether to enable LOCAL capability in the client library for LOAD DATA INFILE

                    //默认为关闭,这里开启

                     -DENABLED_LOCAL_INFILE=1

 

                     //数据库编码设置

                     -DEXTRA_CHARSETS=all

                     -DDEFAULT_CHARSET=utf8

                     -DDEFAULT_COLLATION=utf8-general_ci

linux
相关资讯       MySQL安装  Linux教程 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款