mget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.21.tar.gz cd /u01/mysql-5.6.21 mkdir rpm cd rpm修改mysql.specName: mysql-rpm Version:5.6.21 Release: renfengjun License: GPL URL: http://dev.mysql.com/ Group: applications/database BuildRoot:%{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: cmake Packager: dexter.ren.jl@gmail.com Autoreq: no prefix: /u01/mysql Summary: mysql-5.6.21.tar.gz
%description The MySQL(TM) software delivers a very fast,multi-threaded, multi-user, and robust SQL (Structured Query Language)database server. MySQL Server is intended for mission-critical, heavy-loadproduction systems as well as for embedding into mass-deployed software.
%define MYSQL_USER mysql %define MYSQL_GROUP mysql %define __os_install_post %{nil}
cp my.cnf /u01/mysql/执行远程自动安装命令执行远程拷贝(dcli命令是我从一体机里面拿出来的脚本,py编写,其实和scp差不多,有需要的可以发邮箱)如果批量的安装,需要先使用-k选项初始化一下ssh。将脚本copy到远程[root@centos511 ~]# ./dcli -l root -c192.168.0.36 -f ./auto_install_mysql.sh执行远程命令,也可以放在后台[root@centos511 ~]#./dcli -l root -c192.168.0.36 /root/ auto_install_mysql.sh输出:[[root@centos511 ~]# ./dcli -l root -c192.168.0.36 /root/get_rpm.sh root@192.168.0.36"s password: 192.168.0.36: Address 192.168.0.36 maps tolocalhost, but this does not map back to the address - POSSIBLE BREAK-INATTEMPT! 192.168.0.36: Loaded plugins: fastestmirror,security 192.168.0.36: Loading mirror speeds from cachedhostfile 192.168.0.36: * base: mirrors.btte.net 192.168.0.36: * extras: mirrors.btte.net 192.168.0.36: * updates: mirrors.yun-idc.com 192.168.0.36: Setting up Install Process 192.168.0.36: Packagecmake-2.6.4-5.el5.4.x86_64 already installed and latest version 192.168.0.36: Package gcc-4.1.2-55.el5.x86_64already installed and latest version 192.168.0.36: No package g++ available. 192.168.0.36: Package bison-2.3-2.1.x86_64already installed and latest version 192.168.0.36: Packagencurses-devel-5.5-24.20060715.x86_64 already installed and latest version 192.168.0.36: Packagencurses-devel-5.5-24.20060715.i386 already installed and latest version 192.168.0.36: Package zlib-1.2.3-7.el5.x86_64already installed and latest version 192.168.0.36: Package zlib-1.2.3-7.el5.i386already installed and latest version 192.168.0.36: Nothing to do 192.168.0.36: Please login with USER and PASS. 192.168.0.36: Please login with USER and PASS. 192.168.0.36: KERBEROS_V4 rejected as anauthentication type 192.168.0.36: Interactive mode off. 192.168.0.36: Preparing... ################################################## 192.168.0.36: mysql-rpm ################################################## .......结束。验证一下[root@study2 ~]# service mysql start Starting MySQL.......................[ OK ]
[root@study2 ~]# su - mysql mys[mysql@study2 ~]$ mysql Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 1 Server version: 5.6.21-r5436-log Sourcedistribution
Copyright (c) 2000, 2014, Oracle and/or itsaffiliates. All rights reserved.
Oracle is a registered trademark of OracleCorporation and/or its affiliates. Other names may be trademarks oftheir respective owners.
Type "help;" or "h" for help. Type "c" toclear the current input statement.
root@(none) 12:29:11>show databases ; +--------------------+ | Database | +--------------------+ | information_schema | | dexdb | | mysql | | performance_schema | | test | +--------------------+ 5 rows in set (0.37 sec)
root@(none) 12:29:14>use dexdb ; Database changed root@dexdb 12:29:17>select * from t ; +------+------------+ | id |name | +------+------------+ | 1 |renfengjun | +------+------------+ 1 row in set (0.19 sec)
root@dexdb 12:29:19>quit Bye
[root@study2 ~]# service mysql stop Shutting down MySQL.[ OK ]比较粗糙,还有需要改进的地方。慢慢完善吧。--------------------------------------分割线 --------------------------------------Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htmUbuntu 14.04 LTS 安装 LNMP NginxPHP5 (PHP-FPM)MySQL http://www.linuxidc.com/Linux/2014-05/102351.htmUbuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htmUbuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htmUbuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htmMySQL-5.5.38通用二进制安装 http://www.linuxidc.com/Linux/2014-07/104509.htm--------------------------------------分割线 --------------------------------------本文永久更新链接地址