码迷,mamicode.com
首页 > 数据库 > 详细

[py]py3/pip/mysql环境安装

时间:2018-01-05 18:00:02      阅读:241      评论:0      收藏:0      [点我收藏+]

标签:window   eof   启动mysql   建表   pack   work   virt   虚拟   show   

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

[py]py3/pip/mysql环境安装

标签:window   eof   启动mysql   建表   pack   work   virt   虚拟   show   

原文地址:https://www.cnblogs.com/iiiiiher/p/8205915.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!