摘要: read_config import configparser import os def read_cf(cnf_name, cnf_name_Num1): cp = configparser.ConfigParser() path = os.getcwd() parent_dir = os.pa 阅读全文
posted @ 2020-04-20 15:21 两颗心的章鱼 阅读(94) 评论(0) 推荐(0) 编辑
摘要: mysql——ubuntu 删除mysql sudo apt get autoremove purge mysql server 5.5 sudo apt get remove mysql common 清理残留数据 dpkg l |grep ^rc|awk '{print $2}' |sudo x 阅读全文
posted @ 2020-04-20 15:18 两颗心的章鱼 阅读(564) 评论(0) 推荐(0) 编辑
摘要: 基本命令 启动终端: ctr+alt+t 终端字体放大: ctr+shift+'+',终端字体缩小: ctr+' ' ls: 查看当前目录下的文件信息 pwd: 查看目录所在的路径 touch: 创建文件 mkdir: 创建文件夹 rmdir: 删除文件夹,提示:只能是空文件夹 rm: 默认删除的是 阅读全文
posted @ 2020-04-20 15:17 两颗心的章鱼 阅读(102) 评论(0) 推荐(0) 编辑
摘要: ubuntu启用root用户 sudo passwd root 开启root用户,输入新密码 su root 切换用户登录 sudo vim /etc/pam.d/gdm autologin 注释行 "auth requied pam_succeed_if.so user != root quiet 阅读全文
posted @ 2020-04-20 15:15 两颗心的章鱼 阅读(859) 评论(0) 推荐(0) 编辑
摘要: 1、查看canda版本 conda V 2、创建虚拟环境 conda create name your_env_name python=2.7 conda create name your_env_name python=3 conda create name your_env_name pytho 阅读全文
posted @ 2020-04-20 15:11 两颗心的章鱼 阅读(261) 评论(0) 推荐(0) 编辑
摘要: ![](https://img2020.cnblogs.com/blog/1593091/202004/1593091-20200420150811623-40302586.png) 阅读全文
posted @ 2020-04-20 15:09 两颗心的章鱼 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 10、mysql查看进程 1.进入mysql/bin目录下输入mysqladmin processlist; 2.启动mysql,输入show processlist; 3.kill "进程号" 阅读全文
posted @ 2020-04-20 15:08 两颗心的章鱼 阅读(403) 评论(0) 推荐(0) 编辑
摘要: 11、Mysql 查询是否锁表 1、查询是否锁表 show OPEN TABLES where In_use 0; 2、查询进程 show processlist 查询到相对应的进程===然后 kill id 补充: 查看正在锁的事务 SELECT FROM INFORMATION_SCHEMA.I 阅读全文
posted @ 2020-04-20 15:07 两颗心的章鱼 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 09、查看锁记录等待时间: SHOW VARIABLES LIKE 'innodb_lock_wait_timeout'; show variables like '%timeout'; 阅读全文
posted @ 2020-04-20 15:05 两颗心的章鱼 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 07、防火墙开放3306端口 iptables A INPUT p tcp dport 3306 j ACCEPT iptables A OUTPUT p tcp sport 3306 j ACCEPT 阅读全文
posted @ 2020-04-20 15:04 两颗心的章鱼 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 06、修改非固定ip访问 修改本地mysql.cnf将bing_ardess=127.0.0.1注释 修改mysql库的user表,将host项,从localhost改为%。%这里表示的是允许任意host访问,如果只允许某一个ip访问,则可改为相应的ip use mysql; update user 阅读全文
posted @ 2020-04-20 15:03 两颗心的章鱼 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 05、windows启动mysql net start mysql net stop mysql 阅读全文
posted @ 2020-04-20 15:01 两颗心的章鱼 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 04、ubuntu mysql启动停止重启 linux 启动mysql: 方式一:sudo /etc/init.d/mysql start 方式二:sudo service mysql start 停止mysql: 方式一:sudo /etc/init.d/mysql stop 方式二:sudo s 阅读全文
posted @ 2020-04-20 15:00 两颗心的章鱼 阅读(1209) 评论(0) 推荐(0) 编辑
摘要: 03、 增删改查(curd)(重点 记忆) 3.1增加、插入——insert + + + + + + + | Field | Type | Null | Key | Default | Extra | + + + + + + + | id | int(10) unsigned | NO | PRI 阅读全文
posted @ 2020-04-20 14:58 两颗心的章鱼 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 数据表的操作 查看当前数据库中所有表 show tables; 创建表 int unsigned 无符号整形 auto_increment 表示自动增长 not null 表示不能为空 primary key 表示主键 default 默认值 create table 数据表名字 (字段 类型 约束 阅读全文
posted @ 2020-04-20 14:48 两颗心的章鱼 阅读(73) 评论(0) 推荐(0) 编辑
摘要: mysql 基本操作 链接数据库 mysql uroot pmysql 不显示密码 mysql uroot p mysql 退出数据库 exit/quit/ctrl + d sql语句最后需要有分号;结尾 显示数据库版本 version select version(); 显示时间 select n 阅读全文
posted @ 2020-04-20 14:47 两颗心的章鱼 阅读(112) 评论(0) 推荐(0) 编辑
摘要: loging python log的使用,本代码可直接运行,外部直接调用即可,在日常使用过程中直接复制黏贴即可 !/usr/bin/env python coding:utf 8 Author:zhj import logging, os from logging import handlers c 阅读全文
posted @ 2020-04-20 14:41 两颗心的章鱼 阅读(337) 评论(0) 推荐(0) 编辑
摘要: pip 列出已安装的包 pip list 安装要安装的包 pip install xxx 安装特定版本 pip install django==1.1.5 导出python的环境 pip freeze requestment.txt 从导出的python环境中安装所需要的包 pip install 阅读全文
posted @ 2020-04-20 14:36 两颗心的章鱼 阅读(1274) 评论(0) 推荐(0) 编辑
摘要: os模块(os.path) import os path1=os.path.abspath(__file__) print(path1) 当前文件的绝对路径 path2=os.path.dirname(os.path.abspath(__file__)) print(path2) 当前文件的上一层目 阅读全文
posted @ 2020-04-20 14:34 两颗心的章鱼 阅读(398) 评论(0) 推荐(0) 编辑
摘要: time模块 格式化时间 import time date = '1110 10 10' time_in = time.strptime(date, "%Y %m %d") print(time_in) time.struct_time(tm_year=1110, tm_mon=10, tm_mda 阅读全文
posted @ 2020-04-20 14:33 两颗心的章鱼 阅读(173) 评论(0) 推荐(0) 编辑