• docker 有效指令


    doker mysql   [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
    https://severalnines.com/blog/mysql-docker-containers-understanding-basics
    
    -----------------------
    docker mysql
    --------------------------
     
    镜像安装
     docker  images
     
    版本查询 - https://hub.docker.com/r/mysql/
            - https://dev.aliyun.com/search.htmld 1 1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
    docker pull mysql:5.7.17
    docker pull registry.cn-hangzhou.aliyuncs.com/hhzz/mysql      # 阿里镜像
    docker tag registry.cn-hangzhou.aliyuncs.com/hhzz/mysql:latest mysql:5.7 # 重命名镜像
    1 . 启动 - 基础
    docker run --name maysql_01 
    -p 3306:3306 
    -e MYSQL_ROOT_PASSWORD=123456 
    -d mysql:5.7.17
    2 . 启动 - 自定义配置
    docker run  --name mysql_01   
    -p 3306:3306  
    -v  /home/testsrv/docker/mysql/3306/conf:/etc/mysql/mysql.conf.d 
    -v /home/testsrv/docker/mysql/3306/data:/var/lib/mysql  
    -v /home/testsrv/docker/mysql/3306/logs:/var/log/mysql 
    -e MYSQL_ROOT_PASSWORD=123456  
     -d mysql:5.7.17
    3 . 配置账号
    docker exec -it 7388ab22f6ca sh
    mysql -uroot -p123456;
    use mysql;
    CREATE USER appuser@'%'  IDENTIFIED BY '123456';
    grant all on *.* to appuser@'%'  with grant option; 
    flush privileges;
    
     ------linux 重启之后,docker 的
     docker ps
     docker start f64ccbe92708
     
     
    ps -ef | grep mysqld
     ----------------
     docker run 
    --detach 
    --name=test-mysql 
    --env="MYSQL_ROOT_PASSWORD=mypassword" 
    --publish 6603:3306 
    --volume=/root/docker/test-mysql/conf.d:/etc/mysql/conf.d 
    --volume=/storage/docker/mysql-datadir:/var/lib/mysql 
    mysql 
     
    -----------------------
    docker mysql 登录报错:
    # mysql -uroot -p
    Enter password: 
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
    正确登录:
    # mysql -uroot -p123456 -P3306 -h 192.168.205.122
    mysql: [Warning] Using a password on the command line interface can be insecure.
    Welcome to the MySQL monitor.  Commands end with ; or g.
    Your MySQL connection id is 6
    Server version: 5.7.17 MySQL Community Server (GPL)
    
    Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
    
    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.
    
    Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
    
    mysql> 
    
    ==================
    关于springboot.jar包以service运行时,以普通用户启动service,不以默认的root用户启动
    我需要运行一个Spring .jar应用程序作为一项服务,并找到一种简单的方法来将其作为特定用户运行: 我将我的jar文件的所有者和组更改为我想运行的用户。 然后在init.d中将此jar声明并启动服务。 所以:
    #chown myuser:myuser /var/lib/jenkins/workspace/springApp/target/springApp-1.0.jar
    #ln -s /var/lib/jenkins/workspace/springApp/target/springApp-1.0.jar /etc/init.d/springApp
    #service springApp start
    #ps aux | grep java
    myuser    9970  5.0  9.9 4071348 386132 ?      Sl   09:38   0:21 /bin/java -Dsun.misc.URLClassPath.disableJarChecking=true -jar /var/lib/jenkins/workspace/springApp/target/springApp-1.0.jar
    参考
    https://oomake.com/question/56918
    http://blog.didispace.com/spring-boot-run-backend/
    

      

    Docker:
    systemctl status docker.service  查看docker状态
    systemctl enable docker.service docker开机启动
    软连接:
    Sudo ln -s /var/aiplatform/facewatcher-0.0.1-SNAPSHOT.jar  ./facewatcher
    
    tar zcvf this.tar.gz ./*.txt
    
    tar xzvf this.tar.gz ./
    

      

      

  • 相关阅读:
    mybatis批量插入数据
    oracle的dmp数据文件的导出和导入以及创建用户
    maven安装第三方jar包到本地仓库
    IntelliJ IDEA 注册码,激活
    分布式事务实现-Spanner
    Redis Cluster原理
    twemproxy源码分析
    Paxos可容错的一致性协议
    UpdateServer事务实现机制
    Coroutine及其实现
  • 原文地址:https://www.cnblogs.com/xhzd/p/12058461.html
Copyright © 2020-2023  润新知