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/','/');
  • 相关阅读:
    WEB前端开发规范文档
    MySQL笔记系列:数据库概述
    MySQL笔记系列:MySQL架构
    Centos6.4中Apache,MySQL,PHP 的安装
    Linux面试总结分享
    NFS网络文件共享服务介绍及案例
    Linux命令(7):cp
    Linux命令(6):cat
    Linux命令(5):vi
    Linux命令(4):touch
  • 原文地址:https://www.cnblogs.com/aqicheng/p/11603071.html
Copyright © 2011-2022 走看看