mysql安装测试语句及出现的问题

1.测试是否是正常的mysql(主要指的就是mysql语言的问题)
show variables like 'character_set%'; 
 
2.当出现下面的问题的时候
app01.Person.age: (fields.E210) Cannot use ImageField because Pillow is not installed.
        HINT: Get Pillow at https://pypi.python.org/pypi/Pillow or run command "pip install
Pillow".

下载:

C:\Users\Administrator> pip install Pillow
Collecting Pillow
Downloading https://files.pythonhosted.org/packages/ec/ca/7af5b6628ecf770645f8cc3c9da3c2bb5c5ffc7384a9ff0666fdb818b4d5/Pillow-5.4.1-cp36-cp36m-win_amd64.whl (1.9MB)
100% |████████████████████████████████| 1.9MB 106kB/s
Installing collected packages: Pillow
Successfully installed Pillow-5.4.1

 

这样可以解决一定的问题(枕头)

 

 3.注:数据库迁移的时候出现一个警告

WARNINGS: 
?: (mysql.W002) MySQL Strict Mode is not set for database connection 'default'
HINT: MySQL's Strict Mode fixes many data integrity problems in MySQL, such as data truncation upon insertion, by escalating 
w
arnings into errors. It is strongly recommended you activate it.


出现上方的提示说明是mysql的严格模式出现了问题
只需要在setting.py文件中,在配置中多加一个OPTIONS参数

'OPTIONS': {
    'init_command': "SET sql_mode='STRICT_TRANS_TABLES'"},
 

 

有关数据库的权限的限制

GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'localhost' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
 
FLUSH   PRIVILEGES;

 

posted @ 2019-02-24 15:47  7411  阅读(285)  评论(0)    收藏  举报