Mysql-5.5.32 cmake安装的步骤

这篇文章主要介绍“Mysql-5.5.32 cmake安装的步骤”,在日常操作中,相信很多人在MysqL-5.5.32 cmake安装的步骤问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”MysqL-5.5.32 cmake安装的步骤”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

1.拷贝cmake-2.8.8.tar.gz和MysqL-5.5.32.tar.gz至/opt文件夹下
2.切换到opt目录
[root@MysqL ~]# cd /opt
[root@MysqL opt]# ls
cmake-2.8.8.tar.gz  MysqL-5.5.32.tar.gz  rh

3.解压cmake文件
[root@MysqL opt]# tar xf cmake-2.8.8.tar.gz
[root@MysqL opt]# cd cmake-2.8.8
[root@MysqL cmake-2.8.8]# ls
bootstrap                   CompileFlags.cmake    doxygen.config
ChangeLog.manual            configure             Example
ChangeLog.txt               copyright.txt         Modules
CMakeCPack.cmake            CTestConfig.cmake     Readme.txt
CMakeCPackOptions.cmake.in  CTestCustom.cmake.in  Source
CMakeGraphVizOptions.cmake  CTestCustom.ctest.in  Templates
CMakeLists.txt              DartConfig.cmake      Tests
CMakelogo.gif               DartLocal.conf.in     Utilities
cmake_uninstall.cmake.in    Docs

4.进行cmake的安装
[root@MysqL cmake-2.8.8]# ./configure
CMake has bootstrapped.  Now run gmake.

[root@MysqL cmake-2.8.8]# gmake
[root@MysqL cmake-2.8.8]# gmake install

5.添加MysqL用户和组
[root@MysqL cmake-2.8.8]# groupadd MysqL
[root@MysqL cmake-2.8.8]# useradd MysqL -s /sbin/nologin -M -g MysqL

6.yum安装ncurses-devel
[root@MysqL /]# yum install ncurses-devel -y

7.解压MysqL文件
[root@MysqL /]# cd /opt
[root@MysqL opt]# tar xf MysqL-5.5.32.tar.gz
[root@MysqL opt]# cd MysqL-5.5.32
[root@MysqL MysqL-5.5.32]# ls
BUILD        CMakeLists.txt   copYING  include             libMysqLd    mysys      regex      sql-common     tests     win
BUILD-CMAKE  cmd-line-utils   dbug     INSTALL-SOURCE      libservices  packaging  scripts    storage        unittest  zlib
client       config.h.cmake   Docs     INSTALL-WIN-SOURCE  man          plugin     sql        strings        VERSION
cmake        configure.cmake  extra    libMysqL            MysqL-test   README     sql-bench  support-files  vio

8.安装之前编译MysqL
cmake . -DCMAKE_INSTALL_PREFIX=/application/MysqL-5.5.32 \
-DMysqL_DATADIR=/application/MysqL-5.5.32/data \
-DMysqL_UNIX_ADDR=/application/MysqL-5.5.32/tmp/MysqL.sock \
-DEXTRA_CHARSETS=gbk,gb2312,utf8,ascii \
-DENABLED_LOCAL_INFILE=ON \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
-DWITH_FAST_MUTEXES=1 \
-DWITH_ZLIB=bundled \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_READLINE=1 \
-DWITH_EMbedDED_SERVER=1 \
-DWITH_DEBUG=0


9.MysqL安装

[root@MysqL MysqL-5.5.32]# make && make install
[root@MysqL MysqL-5.5.32]# ln -s /application/MysqL-5.5.32/ /application/MysqL

如果make到63%左右出现错误
make[2]: *** [storage/perfschema/unittest/pfs_connect_attr-t] Error 1
make[1]: *** [storage/perfschema/unittest/CMakeFiles/pfs_connect_attr-t.dir/all] Error 2
则:cmake去掉-DWITH_PARTITION_STORAGE_ENGINE=1参数重新编译 


10.选择配置文件
[root@MysqL MysqL-5.5.32]# cp support-files/my-small.cnf /etc/my.cnf
cp: overwrite `/etc/my.cnf'? y

11.查看是否有MysqL/data目录
[root@MysqL MysqL-5.5.32]# ll /application/MysqL/data/
total 4
drwxr-xr-x. 2 root root 4096 Aug 15 15:38 test

12.相关授权
[root@MysqL MysqL-5.5.32]# chown -R MysqL.MysqL /application/MysqL/data/
[root@MysqL MysqL-5.5.32]# chmod -R 1777 /tmp/

13.数据库初始化
[root@MysqL MysqL-5.5.32]# cd /application/MysqL/scripts/
[root@MysqL scripts]# ls
MysqL_install_db
[root@MysqL scripts]# cd /application/MysqL/scripts/
[root@MysqL scripts]# ./MysqL_install_db --basedir=/application/MysqL/ --datadir=/application/MysqL/data/ --user=MysqL
Installing MysqL system tables...
OK
Filling help tables...
OK

14.启动配置
[root@MysqL MysqL]# cd /opt/MysqL-5.5.32
[root@MysqL MysqL-5.5.32]# cp support-files/MysqL.server /etc/init.d/MysqLd
[root@MysqL MysqL-5.5.32]# chmod +x /etc/init.d/MysqLd
[root@MysqL MysqL-5.5.32]# /etc/init.d/MysqLd start
Starting MysqL.. SUCCESS!
[root@MysqL MysqL-5.5.32]# netstat -lntup|grep 3306
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      28462/MysqL

15.配置环境变量
[root@MysqL MysqL-5.5.32]# echo 'export PATH=/application/MysqL/bin:$PATH'>>/etc/profile
[root@MysqL MysqL-5.5.32]# tail -1 /etc/profile
export PATH=/application/MysqL/bin:$PATH
[root@MysqL MysqL-5.5.32]# source /etc/profile
[root@MysqL MysqL-5.5.32]# echo $PATH
/application/MysqL/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

16.登陆MysqL删除无用配置
[root@MysqL MysqL-5.5.32]# MysqL
MysqL> delete from MysqL.user where user='';
MysqL> delete from MysqL.user where host='MysqL';
MysqL> delete from MysqL.user where host='::1';
MysqL> select user,host from MysqL.user;
+------+-----------+
| user | host      |
+------+-----------+
| root | 127.0.0.1 |
| root | localhost |
+------+-----------+
MysqL> drop database test;

17.配置登陆密码
[root@MysqL MysqL-5.5.32]# /application/MysqL//bin/MysqLadmin -u root password 'cancer'

18.设置MysqL开机启动
[root@MysqL MysqL-5.5.32]# chkconfig MysqLd on
[root@MysqL MysqL-5.5.32]# chkconfig --list MysqLd
MysqLd          0:off   1:off   2:on    3:on    4:on    5:on    6:off

19.查看系统语言
[root@MysqL MysqL-5.5.32]# cat /etc/sysconfig/i18n
LANG="en_US.UTF-8"
SYSFONT="latarcyrheb-sun16"

到此,关于“MysqL-5.5.32 cmake安装的步骤”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注编程之家网站,小编会继续努力为大家带来更多实用的文章

相关文章

这篇文章主要介绍“hive和mysql的区别是什么”,在日常操作中...
这篇“MySQL数据库如何改名”文章的知识点大部分人都不太理解...
这篇文章主要介绍“mysql版本查询命令是什么”的相关知识,小...
本篇内容介绍了“mysql怎么修改字段的内容”的有关知识,在实...
这篇文章主要讲解了“mysql怎么删除unique约束”,文中的讲解...
今天小编给大家分享一下mysql怎么查询不为空的字段的相关知识...