運行了語句:
grant all privileges on stocktrading to 'trading'@'localhost';
之后在django中調用命令
python manage.py migrate
發現報錯:
在mysql中使用show grants for 'trading'@'localhost'命令查看權限發現:
明明已經grant all privileges了,為什么沒有創建表的權限呢?
解決方法:
使用命令
GRANT ALL PRIVILEGES ON *.* TO 'trading'@'localhost';
之后就可以了。
具體原因不詳......