数据库创建用户和受权限
# 在数据库创建一个luffy用户,密码是Luffy123?,只能对luffy_api库有操作权限 -查看数据库的用户:select user,host,authentication_string from mysql.user; -创建用户;grant 权限(create, update) on 库.表 to '账号'@'host' identified by '密码' grant all privileges on luffy_api.* to 'luffy'@'%' identified by 'Luffy123'; grant all privileges on luffy_api.* to 'luffy'@'localhost' identified by 'Luffy123'; """ 如MySQL版本在5.7以上时,创建用户和权限要分开设不然会报错: ip地址 create user luffy@"%" identified by "Luffy123"; grant all on luffy_api.* to luffy@"%" with grant option; 本地localhost create user luffy@"localhost" identified by "Luffy123"; grant all on luffy_api.* to luffy@"localhost" with grant option; """
本文来自博客园,作者:{Mr_胡萝卜须},转载请注明原文链接:https://www.cnblogs.com/Mr-fang/p/16448766.html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)