V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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 · 2019-01-20 17:28:34 +08:00 · 1846 次点击
    这是一个创建于 1916 天前的主题,其中的信息可能已经有所发展或是发生改变。
    网上找了很多,老是在赋权限的时候报错,不知道为啥,百度了一下,大多说的都是创建表的时候出错,和我问题不符合 grant all privileges on zhangsanDb.* to zhangsan@'%' identified by 'zhangsan';
    6 条回复    2019-01-21 18:57:07 +08:00
    fmumu
        1
    fmumu  
       2019-01-20 18:04:08 +08:00
    问问题时候描述清楚,报错,报错信息是什么?数据库是什么版本?
    先说一种可能性,mysql8 不能用 grant 命令创建用户并授权
    sonyxperia
        2
    sonyxperia  
       2019-01-20 18:56:48 +08:00
    所以为什么在 python 节点
    james2013
        3
    james2013  
       2019-01-21 08:44:22 +08:00
    以前换 mysql 新版本时,也碰到过这个问题,后来在官方文档上找到新的方法:
    grant usage on zhangsanDb.* to zhangsan@'%' identified by 'zhangsan';
    https://dev.mysql.com/doc/refman/8.0/en/grant.html
    dadama
        4
    dadama  
       2019-01-21 09:30:47 +08:00 via Android
    一楼说的对
    james2013
        5
    james2013  
       2019-01-21 10:39:30 +08:00
    上次我弄错了,找到以前的为知笔记:
    创建用户:create user 'zhangsan'@'%' identified by '12345678';
    设置数据库权限:GRANT ALL ON *.* TO 'zhangsan'@'%'; flush privileges;
    love9918
        6
    love9918  
    OP
       2019-01-21 18:57:06 +08:00
    已经解决,谢谢大家,是版本的问题,最新版本可能不兼容,我现在换成 5.7 版本可以了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2768 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 12:14 · PVG 20:14 · LAX 05:14 · JFK 08:14
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.