欢迎来到天天文库
浏览记录
ID:50370048
大小:38.80 KB
页数:8页
时间:2020-03-08
《MySQL的自动化安装部署.docx》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、一、实验环境操作系统:OracleEnterpriseLinux5.7虚拟机:192.168.1.200(建立mysql安装模板)192.168.1.201(验证自动安装脚本)MySQL版本:mysql5.5.37二、模板机安装mysql(192.168.1.200)1.安装必备的包和工具#rpm–ivhgcc-4.1.2-51.el5.x86_64.rpm#rpm–ivhgcc-c++-4.1.2-51.el5.x86_64.rpm#rpm–ivhcmake-2.6.4-5.el5.4.x86_64.rpm#rpm–
2、ivhbison-2.3-2.1.x86_64.rpm#rpm–ivhncurses-devel-5.5-24.20060715.x86_64.rpm#rpm–ivhzlib-1.2.3-4.el5.x86_64.rpm2.创建mysql组和用户#groupaddmysql#useradd-gmysqlmysql3.上传并解压mysql源码文件#tarzxvfmysql-5.5.37.tar.gz4.配置、编译并安装#cdmysql-5.5.37#CFLAGS="-O3-g-fno-exceptions-static-
3、libgcc-fno-omit-frame-pointer-fno-strict-aliasing"#CXX=g++#CXXFLAGS="-O3-g-fno-exceptions-fno-rtti-static-libgcc-fno-omit-frame-pointer-fno-strict-aliasing"#exportCFLAGSCXXCXXFLAGS#cmake.-DSYSCONFDIR:PATH=%{prefix}-DCMAKE_INSTALL_PREFIX:PATH=%{prefix}-DCMAKE_
4、BUILD_TYPE:STRING=Release-DENABLE_PROFILING:BOOL=ON-DWITH_DEBUG:BOOL=OFF-DWITH_VALGRIND:BOOL=OFF-DENABLE_DEBUG_SYNC:BOOL=OFF-DWITH_EXTRA_CHARSETS:STRING=all-DWITH_SSL:STRING=bundled-DWITH_UNIT_TESTS:BOOL=OFF-DWITH_ZLIB:STRING=bundled-DWITH_PARTITION_STO
5、RAGE_ENGINE:BOOL=ON-DWITH_INNOBASE_STORAGE_ENGINE:BOOL=ON-DWITH_ARCHIVE_STORAGE_ENGINE:BOOL=ON-DWITH_BLACKHOLE_STORAGE_ENGINE:BOOL=ON-DWITH_PERFSCHEMA_STORAGE_ENGINE:BOOL=ON-DDEFAULT_CHARSET=utf8-DDEFAULT_COLLATION=utf8_general_ci-DWITH_EXTRA_CHARSETS=all
6、-DENABLED_LOCAL_INFILE:BOOL=ON-DWITH_EMBEDDED_SERVER=0-DINSTALL_LAYOUT:STRING=STANDALONE-DCOMMUNITY_BUILD:BOOL=ON-DMYSQL_SERVER_SUFFIX='-r5436';#make-j`cat/proc/cpuinfo
7、grepprocessor
8、wc-l`#makeinstall1.初始化数据库#mkdir–p/project/class2/mysql/log/#chown–Rmysql:m
9、ysql/project/class2/mysql#chmod–R755/project/class2/mysql#scripts/mysql_install_db --user=mysql --basedir=/project/class2/mysql --datadir=/project/class2/mysql/data 2.上传配置文件将编辑好的my.cnf文件上传到mysql根目录和/etc目录下,注意修改server_id3.启动mysql启动msql#bin/mysqld_safe --user=mys
10、ql & 使用netstat命令检查3306端口确认是否启动成功#netstat-an
11、grep3306如未启动,查看/project/class2/mysql/log目录下的alert.log中错误信息4.配置mysql自启动#cp support-files/mysql.server /etc/init.d/mysql
此文档下载收益归作者所有