由于py中最常用的关系型数据库是 mysql ,因此我们今天来简单的讲讲它的安装及可视化软件的使用(大神可忽略),好,我们直接进入正题:
想要使用 mysql,我们必须要进官网下载,这里我就以免安装版作为例子,因为免安装配置超简单,省略掉了安装的繁琐操作,下载网址为:https://dev.mysql.com/downloads/mysql/ ,然后选择对应的操作系统版本并下载,操作图如下:
0.png1.png
下载完之后,我们将压缩包解压,进入解压后的根目录并创建一个 my.ini 文件,配置如下(原文来自:http://www.jb51.net/article/139244.htm):
[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required.
#这里是要配置的内容,数据库文件夹没有可手动创建一个
basedir = D:\MySoftware\MySQL\mysql-8.0.11-winx64
datadir = D:\MySoftware\MySQL\mysql-8.0.11-winx64\data
port = 3306
lower_case_table_names = 2
default_authentication_plugin=mysql_native_password
# server_id = .....
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
character-set-server = utf8mb4
performance_schema_max_table_instances = 600
table_definition_cache = 400
table_open_cache = 256
[mysql]
default-character-set = utf8mb4
[client]
default-character-set = utf8mb4
网友评论