zoukankan      html  css  js  c++  java
  • sql学习

    1.把表批量导入导其他数据库的某表

    insert into dsyh_system.api_user_address
    
    select id id,user_id user_id,`name` `name`,phone phone,province,city,county,info,
    case is_default when 1 then 1 when 99 then 0 END as is_default,insert_time as create_time ,update_time,
    case is_delete when 1 then 1 when -1 then 0 end DELETE_flag
    from dsyh_eshop.cm_user_address_tbl

    2.mysql配置主从复制遇到的问题

    change master to master_host='172.24.254.105',master_port=31857, master_user='dshb', master_password='20190923',master_log_file='binlog.000003', master_log_pos=154;
    
    grant replication slave on *.* to 'dshb'@'localhost' identified by '20190923';

    创建数据库:

    CREATE DATABASE IF NOT EXISTS testDB default charset utf8 COLLATE utf8_general_ci;
    创建数据库用户: create user 'csadmin'@'%' identified by '123456';
    修改用户密码:update user set password=password(‘123456‘) where user=‘root‘;
    创建数据库用户并允许远程登陆:grant all on *.* to admin@'%' identified by '123456' with grant option; 
    给与所有权限:grant all privileges on tests.* to csadmin@'%' identified by '123456';
    给与某个用户某个数据的全部权限:grant all privileges on test.* to csadmin@'%' identified by '123456';

    3.网络常用

    查看mac地址:arp -a
    查看IP:ipconfig/all

     4.模糊查询

    UPDATE dsyh_goods.bus_goods SET logo_img=REPLACE(logo_img,'/client/www.dongshanhaibao.com/','/');
  • 相关阅读:
    006_tcpdump专题
    002_阿里监控平台的“打怪升级”之路
    001_谈阿里核心业务监控平台SunFire的技术架构
    001_前端面试集合
    007_zkCli.sh
    007_Chrome的Waterfall详解
    021_supervise进行管理利器
    028_shell脚本递归求值
    MySQL -- 在磁盘爆满后复制的状态
    MySQL -- 内存使用监控详解
  • 原文地址:https://www.cnblogs.com/aqicheng/p/11603071.html
Copyright © 2011-2022 走看看