[x]python安装mysql
我下载的版本是 PyMySQL-0.9.3.tar.gz (75.3 kB)
2.下载解压后,为方便起见,放到python同目录下,进入C:Danacondamysql-8.0.18-winx64目录,
执行python setup.py install安装
3.安装完成后,import pymysql,不报错,完美安装
[x]window10安装mysql
1.下载 官网下载网址:https://dev.mysql.com/downloads/mysql/
我下载的是
Windows (x86, 64-bit), ZIP Archive 187.8M (mysql-8.0.19-winx64.zip)
2.解压,我放到了目录C:Dmysql-8.0.19-winx64
3.目录C:Dmysql-8.0.19-winx64下配置my.ini。如果有ini文件,重命名为my.ini,如果没有,直接新建
[client] (好像写不写都行,反正我是这么写了)
port=3306
user=mysql
password=123456
[mysqld](必须)
innodb_buffer_pool_size=83M
basedir = C:Program FilesMySQLMySQL Server 5.7
datadir = C:Program FilesMySQLMySQL Server 5.7data
port = 3306
server_id = 1
sort_buffer_size=256K
join_buffer_size = 8M
read_rnd_buffer_size=256K
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
4.配置环境变量,
右键计算机–属性–高级系统设置–环境变量,在系统变量中找到Path,追加的mysql的bin文件夹地址,我的是C:Danacondamysql-8.0.18-winx64in
5.管理员身份打开cmd,进入mysql的bin目录,cd C:Danacondamysql-8.0.18-winx64in
6.初始化, mysqld –-initialize 会自动创建data目录
7.安装MySQL服务,在bin路径下输入:mysqld install
8.启动服务。管理员模式进入cmd输入:net start mysql 提示服务启动成功。
9.登录MySQL。cmd输入:mysql -u root -p
这时会提示你输入密码。打开MySQL根目录下的data文件夹,找到后缀是.err的文件以文本打开找到password临时密码(可以ctrl+f搜索)然后在cmd中输入该临时密码,一般初始密码为空,直接enter就可以。
————————————————
版权声明:本文为CSDN博主「coder_afly」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。