V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
love9918
V2EX  ›  Python

心累啊!数据库创建一个新用户赋权限问题

  •  
  •   love9918 · Jan 20, 2019 · 2801 views
    This topic created in 2663 days ago, the information mentioned may be changed or developed.
    网上找了很多,老是在赋权限的时候报错,不知道为啥,百度了一下,大多说的都是创建表的时候出错,和我问题不符合 grant all privileges on zhangsanDb.* to zhangsan@'%' identified by 'zhangsan';
    6 replies    2019-01-21 18:57:07 +08:00
    fmumu
        1
    fmumu  
       Jan 20, 2019
    问问题时候描述清楚,报错,报错信息是什么?数据库是什么版本?
    先说一种可能性,mysql8 不能用 grant 命令创建用户并授权
    sonyxperia
        2
    sonyxperia  
       Jan 20, 2019
    所以为什么在 python 节点
    james2013
        3
    james2013  
       Jan 21, 2019
    以前换 mysql 新版本时,也碰到过这个问题,后来在官方文档上找到新的方法:
    grant usage on zhangsanDb.* to zhangsan@'%' identified by 'zhangsan';
    https://dev.mysql.com/doc/refman/8.0/en/grant.html
    dadama
        4
    dadama  
       Jan 21, 2019 via Android
    一楼说的对
    james2013
        5
    james2013  
       Jan 21, 2019
    上次我弄错了,找到以前的为知笔记:
    创建用户:create user 'zhangsan'@'%' identified by '12345678';
    设置数据库权限:GRANT ALL ON *.* TO 'zhangsan'@'%'; flush privileges;
    love9918
        6
    love9918  
    OP
       Jan 21, 2019
    已经解决,谢谢大家,是版本的问题,最新版本可能不兼容,我现在换成 5.7 版本可以了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5180 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 01:08 · PVG 09:08 · LAX 18:08 · JFK 21:08
    ♥ Do have faith in what you're doing.