win下正确姿势安装py3
- 选择64bit的python3
- 选择自定义安装
- 选择安装位置
- 安装pip
yum install install python-pip -y
cd
mkdir ~/.pip
cat > .pip/pip.conf<<EOF
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
EOF
- 安装虚拟环境
pip install virtualenv
pip install virtualenvwrapper
pip install virtualenvwrapper-win
mkvirtualenv --python=C:\Python27\python.exe py27env
exit
mkvirtualenv --python=C:\Python36\python.exe py36env
workon #查看刚刚创建的环境,mkvirtualenv -h查看帮助
- py3安装mysql-devel驱动程序
pip install pymysql
pycharm设置
- 导入配置
wget https://github.com/lannyMa/scripts/blob/master/pycharm/settings.jar
file -> import settings就ok了
黄色不伤害眼睛的rgb
255 251 232
FFFBE8
- 设置terminal
File -> Settings -> Tools -> Terminal
for 64bit:
"C:\Program Files\Git\bin\sh.exe" -login -i
for 32bit:
"C:\Program Files (x86)\Git\bin\sh.exe" -login -i
"C:\Windows\System32\cmd.exe" /C "bash"
mysql for win
下载安装
MySQL Community Server 5.7.16
http://dev.mysql.com/downloads/mysql/
cd D:\Program Files\mysql-5.7.19-winx64\bin
mysqld --initialize-insecure
添加path
D:\Program Files\mysql-5.7.19-winx64\bin
启动MySQL服务
"D:\Program Files\mysql-5.7.19-winx64\bin\mysqld" --install
net start mysql
mysql -u root -p
"D:\Program Files\mysql-5.7.19-winx64\bin\mysqld" --remove
net stop mysql
create database bbs;
grant all on bbs.* to dev@localhost identified by '123456';
grant all on bbs.* to dev@'%' identified by '123456';
字符集
SET NAMES 'utf8';
SET character_set_client = utf8;
SET character_set_connection = utf8;
SET character_set_database = utf8;
SET character_set_results = utf8;
SET character_set_server = utf8;
SET collation_connection = utf8_general_ci;
SET collation_database = utf8_general_ci;
SET collation_server = utf8_general_ci;
缺陷是: 登出后设置的就失效了.
show variables like '%storage_engine%';
show VARIABLES like '%max_allowed_packet%';
show variables like '%storage_engine%';
show variables like 'collation_%';
show variables like 'character_set_%';
mysql另一种配置文件持久化:
D:\Program Files\mysql-5.7.19-winx64\my.ini
[mysqld]
default-storage-engine = innodb
innodb_file_per_table = 1
character-set-server = utf8
collation-server = utf8_general_ci
init-connect = 'SET NAMES utf8'
[mysql]
default-character-set = utf8
[mysql.server]
default-character-set = utf8
[mysqld_safe]
default-character-set = utf8
[client]
default-character-set = utf8
参考: http://blog.csdn.net/u013474104/article/details/52486880
mysql配置及命令参考
- mysql生产配置参考
https://www.teakki.com/p/57e227aea16367940da625f8
- 配置文件查找先后顺序
C:\ProgramData\MySQL\MySQL Server 5.7\my.ini
C:\windows\my.ini
C:\my.ini
E:\dev\mysql57\my.ini
- 通过配置文件设置字符集
default-storage-engine = innodb
innodb_file_per_table = 1
character-set-server = utf8
collation-server = utf8_general_ci
init-connect = 'SET NAMES utf8'
- 查看建表语句
show create database test;
- 查看权限
show grants