美文网首页
2018-01-16

2018-01-16

作者: 乌子啦 | 来源:发表于2018-01-19 17:19 被阅读0次

    1.mysql安装 参考http://blog.csdn.net/liyf155/article/details/61419623
    mysql官网->community->mysql community server->64位安装包
    [root@worker1 tmp]# rpm -qa|grep mysql
    mysql-libs-5.1.71-1.el6.x86_64
    [root@worker1 tmp]# rpm -e --nodeps mysql-libs-5.1.71-1.el6.x86_64 //卸载

    1. rpm -ivh mysql-community-common-5.7.12-1.el6.x86_64.rpm
    2. rpm -ivh mysql-community-libs-5.7.12-1.el6.x86_64.rpm
    3. rpm -ivh mysql-community-devel-5.7.12-1.el6.x86_64.rpm
    4. rpm -ivh mysql-community-client-5.7.12-1.el6.x86_64.rpm
    5. rpm -ivh mysql-community-server-5.7.12-1.el6.x86_64.rpm

    如果报warning: mysql-community-server-5.7.21-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
    [root@localhost mysql]# rpm -ivh mysql-community-server-5.7.21-1.el7.x86_64.rpm --force --nodeps

    创建用户
    CREATE USER 'www'@'localhost' IDENTIFIED BY '111111';
    grant all on . to 'www'@'localhost';//授权
    create database sc_switchingroom;
    use sc_switchingroom ;
    source sc_ switchingroom.sql;

    表名忽略大小写
    vim /etc/my.cnf
    添加
    [mysqld]
    lower_case_table_names=1

    2.jdk1.8安装 http://blog.csdn.net/langzi_zhang/article/details/52679452
    jdk官网->jdk 8u151
    su 切换超级管理员
    cd /usr/local
    mkdir jdk 创建jdk文件夹
    cd JDK文件夹位置
    cp 文件名 /usr/local/jdk -r
    cd /usr/local/jdk
    chmod +x 文件名 添加可执行权限
    rpm -ivh 文件名 安装

    配置环境变量
    ①#vim /etc/profile 进入编辑profile文件
    ②在profile文件最后追加入如下内容:
    export JAVA_HOME=/usr/java/jdk1.8.0_161
    export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
    export PATH=$PATH:$JAVA_HOME/bin

    涉及命令如下:
    a.显示当前目录:dwr
    b.打开文件光标设置最后一行:vi +profile
    c.向下插入一行:o
    d.编辑后按【esc】:x保存退出
    e.环境变量生效:source profile

    3.tomcat
    官网下载tomcat7
    cd /usr/local
    mkdir tomcat7
    cd 文件目录
    cp apache-tomcat-7.0.82.tar.gz /usr/local/tomcat7 -r
    cd /usr/local/tomcat7
    tar zxvf apache-tomcat-7.0.82.tar.gz
    cd /usr/local/tomcat7/apache-tomcat-7.0.82/bin
    chmod +x *.sh 添加可执行权限
    ./startup.sh

    4.地图服务
    参照https://www.cnblogs.com/luxiaoxun/p/5022333.html
    无权限用 :wq!
    解压zip unzip命令
    访问localhost:8080/geowebcache

    删除文件夹实例:
    rm -rf /var/log/httpd/access
    将会删除/var/log/httpd/access目录以及其下所有文件、文件夹
    2
    删除文件使用实例:
    rm -f /var/log/httpd/access.log
    将会强制删除/var/log/httpd/access.log这个文件

    存储过程
    drop procedure if exists getHourData;
    DELIMITER //
    create procedure getHourData()
    begin
    insert into scp_ammeter_hours(com_id,addr_hex,Kwh_hex,UsedValue,date_ymd,hour) select com_id,addr_hex,max(Kwh_hex),max(Kwh_hex)-min(Kwh_hex),date_format(created_at,'%y-%m-%d'),if(HOUR(NOW())-1>=0,HOUR(NOW())-1,23) from scp_ammeter_history where created_at between date_sub(date_format(now(),'%Y-%m-%d %H:00:00'),interval 1 hour) and date_format(now(),'%Y-%m-%d %H:00:00') group by com_id,addr_hex;
    end
    //

    相关文章

      网友评论

          本文标题:2018-01-16

          本文链接:https://www.haomeiwen.com/subject/pyosoxtx.html