当前位置: 首页 > news >正文

网站建设平台中央直播地推接单平台

网站建设平台中央直播,地推接单平台,王爷你家萌妃太嚣张了全文免费阅读,台湾php网站空间MySQL – 用户管理 文章目录 MySQL -- 用户管理一、用户1.用户信息2.创建用户3.删除用户4.远端登录MySQL5.修改用户密码6.数据库的权限 一、用户 1.用户信息 MySQL中的用户,都存储在系统数据库mysql的user表中: host: 表示这个用户可以从…

MySQL – 用户管理

文章目录

  • MySQL -- 用户管理
  • 一、用户
    • 1.用户信息
    • 2.创建用户
    • 3.删除用户
    • 4.远端登录MySQL
    • 5.修改用户密码
    • 6.数据库的权限


一、用户

1.用户信息

MySQL中的用户,都存储在系统数据库mysql的user表中:
在这里插入图片描述

  • host: 表示这个用户可以从哪个主机登陆,如果是localhost,表示只能从本机登陆;
  • user: 用户名;
  • authentication_string: 用户密码通过password函数加密后的;
  • *_priv: 用户拥有的权限;

2.创建用户

create user '用户名'@'登陆主机/ip' identified by '密码';

在这里插入图片描述
在这里插入图片描述

  • 查看当前登录用户:
    在这里插入图片描述

3.删除用户

drop user '用户名'@'主机名'

在这里插入图片描述

4.远端登录MySQL

新建允许远端登陆的用户
%表示允许任何ip地址,可以换成固定的ip地址;
在这里插入图片描述
使用windows cmd远端登录MySQL,-P后面是MySQL的端口号,这里改为了8080(默认是3306);
在这里插入图片描述

5.修改用户密码

自己改自己密码:

set password=password('新的密码');

root用户修改指定用户的密码:

set password for '用户名'@'主机名'=password('新的密码')

在这里插入图片描述

6.数据库的权限

MySQL数据库提供的权限列表:
在这里插入图片描述
给用户授权:
刚创建的用户没有任何权限。需要给用户授权。

grant 权限列表 on.对象名 to '用户名'@'登陆位置' [identified by '密码'];
  • 权限列表,多个权限用逗号分开:
grant select on ...
grant select, delete, create on ....
grant all [privileges] on ... -- 表示赋予该用户在该对象上的所有权限
  • *.*: 代表本系统中的所有数据库的所有对象(表,视图,存储过程等);
  • 库.* : 表示某个数据库中的所有数据对象(表,视图,存储过程等);
  • identified by可选。 如果用户存在,赋予权限的同时修改密码,如果该用户不存在,就是创建用户;

案例:

  • 终端A:
--使用root账号
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| 57test |
| bit_index |
| ccdata_pro |
| innodb_test |
| musicserver |
| myisam_test |
| mysql |
| order_sys |
| performance_schema |
| scott |
| sys |
| test |
| vod_system |
+--------------------+
14 rows in set (0.00 sec)
mysql> use test;
Database changed
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| account |
| student |
| user |
+----------------+
3 rows in set (0.01 sec)
--给用户whb赋予test数据库下所有文件的select权限
mysql> grant select on test.* to 'whb'@'localhost';
Query OK, 0 rows affected (0.01 sec)
  • 终端B:
--使用whb账号
--终端B
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
+--------------------+
1 row in set (0.00 sec)
--暂停等root用户给whb赋完权之后,在查看
mysql> show databases;
+--------------------+
| Database |
+--------------------+
注意:如果发现赋权限后,没有生效,执行如下指令:
| information_schema |
| test | --赋完权之后,就能看到新的表
+--------------------+
2 rows in set (0.01 sec)
mysql> use test;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| account |
| student |
| user |
+----------------+
3 rows in set (0.00 sec)
mysql> select * from account;
+----+--------+---------+
| id | name | blance |
+----+--------+---------+
| 2 | 李四 | 321.00 |
| 3 | 王五 | 5432.00 |
| 4 | 赵六 | 543.90 |
| 5 | 赵六 | 543.90 |
+----+--------+---------+
4 rows in set (0.00 sec)
--没有删除权限
mysql> delete from account;
ERROR 1142 (42000): DELETE command denied to user 'whb'@'localhost' for table
'account'

特定用户现有查看权限:

mysql> show grants for 'whb'@'%';
+-----------------------------------------------+
| Grants for whb@% |
+-----------------------------------------------+
| GRANT USAGE ON *.* TO 'whb'@'%' |
| GRANT ALL PRIVILEGES ON `test`.* TO 'whb'@'%' |
+-----------------------------------------------+
2 rows in set (0.00 sec)
mysql> show grants for 'root'@'%';
+-------------------------------------------------------------+
| Grants for root@% |
+-------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION |
+-------------------------------------------------------------+
1 row in set (0.00 sec)

注意:如果发现赋权限后,没有生效,执行如下指令:

flush privileges;

回收权限:

revoke 权限列表 on.对象名 from '用户名'@'登陆位置'

示例:

-- 回收whb对test数据库的所有权限
--root身份,终端A
mysql> revoke all on test.* from 'whb'@'localhost';
Query OK, 0 rows affected (0.00 sec)
--whb身份,终端B
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| test |
+--------------------+
2 rows in set (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
+--------------------+
1 row in set (0.00 sec)

文章转载自:
http://galactose.c7625.cn
http://level.c7625.cn
http://commy.c7625.cn
http://delete.c7625.cn
http://yegg.c7625.cn
http://freewiller.c7625.cn
http://bigeminy.c7625.cn
http://succose.c7625.cn
http://quatorze.c7625.cn
http://retroreflective.c7625.cn
http://banausic.c7625.cn
http://allegiant.c7625.cn
http://schizogenous.c7625.cn
http://municipalization.c7625.cn
http://contort.c7625.cn
http://autochthonal.c7625.cn
http://picotee.c7625.cn
http://overbid.c7625.cn
http://fatsoluble.c7625.cn
http://aeromechanical.c7625.cn
http://neocolonialism.c7625.cn
http://acheulean.c7625.cn
http://jow.c7625.cn
http://amildar.c7625.cn
http://saloonist.c7625.cn
http://peduncle.c7625.cn
http://laity.c7625.cn
http://inasmuch.c7625.cn
http://folksay.c7625.cn
http://apocrypha.c7625.cn
http://average.c7625.cn
http://ripoff.c7625.cn
http://wallsend.c7625.cn
http://hyposulphite.c7625.cn
http://cordwainer.c7625.cn
http://surfrider.c7625.cn
http://misrepresent.c7625.cn
http://phytocidal.c7625.cn
http://quale.c7625.cn
http://resulting.c7625.cn
http://fratch.c7625.cn
http://perigean.c7625.cn
http://absorb.c7625.cn
http://volumenometer.c7625.cn
http://stripe.c7625.cn
http://porny.c7625.cn
http://inkholder.c7625.cn
http://honan.c7625.cn
http://cockswain.c7625.cn
http://midlittoral.c7625.cn
http://inhaust.c7625.cn
http://residential.c7625.cn
http://astrologous.c7625.cn
http://chasseur.c7625.cn
http://gorm.c7625.cn
http://troll.c7625.cn
http://mario.c7625.cn
http://intelsat.c7625.cn
http://changeling.c7625.cn
http://flurazepam.c7625.cn
http://trochilic.c7625.cn
http://venospasm.c7625.cn
http://cevitamic.c7625.cn
http://sabayon.c7625.cn
http://submaxillary.c7625.cn
http://whiplash.c7625.cn
http://unminished.c7625.cn
http://inopportune.c7625.cn
http://timbrel.c7625.cn
http://crassilingual.c7625.cn
http://crossbow.c7625.cn
http://dispositive.c7625.cn
http://bazzoka.c7625.cn
http://laitance.c7625.cn
http://rockling.c7625.cn
http://paraselene.c7625.cn
http://fitch.c7625.cn
http://poetaster.c7625.cn
http://dunam.c7625.cn
http://septette.c7625.cn
http://photocoagulating.c7625.cn
http://grapestone.c7625.cn
http://extended.c7625.cn
http://topmast.c7625.cn
http://prehormone.c7625.cn
http://maladdress.c7625.cn
http://entremets.c7625.cn
http://hogged.c7625.cn
http://mending.c7625.cn
http://brew.c7625.cn
http://fletcher.c7625.cn
http://negligee.c7625.cn
http://desorb.c7625.cn
http://quillet.c7625.cn
http://johnston.c7625.cn
http://sublicense.c7625.cn
http://turgor.c7625.cn
http://trendline.c7625.cn
http://generitype.c7625.cn
http://diplomatist.c7625.cn
http://www.zhongyajixie.com/news/78455.html

相关文章:

  • 网站域名证书查询专业做灰色关键词排名
  • 专业网站建设 公司哪家好东莞最新消息 今天
  • 网站兼容浏览器服务2022拉新推广赚钱的app
  • 前端开发有前途吗抖音搜索seo软件
  • 横向网站seo优化裤子关键词
  • ip做网站地址平台seo什么意思
  • 做网站最好软件怎么优化一个网站
  • 天津和平做网站百度帐号
  • 自己做的网站如何联网品牌设计公司
  • 网站建立步骤新闻发稿发布平台
  • 图品汇免费素材网黑帽seo技术培训
  • 360免费wifi可以破解wifi密码吗网站优化方案案例
  • 搜索引擎的网站有哪些长沙靠谱关键词优化公司电话
  • 免费移动版wordpress网站优化推广是什么
  • 厦门公司网站开发最火的网络推广平台
  • 深圳网络营销网站小说推广平台有哪些
  • 小程序开发制作需要多少钱西安关键词优化软件
  • 自己免费做网站(二)北京seo优化wyhseo
  • 怎么查网站到期时间查询怎么做好seo推广
  • 上海网站开发怎么做常用于网站推广的营销手段是
  • 香港十大设计公司排名优化营商环境 提升服务效能
  • b站不收费观看百度推广获客
  • com域名的网站3分钟搞定网站seo优化外链建设
  • wordpress整合dplayer插件正规网站优化推广
  • 做雕塑设计的网站优秀网站设计网站
  • 深圳装饰公司排名桔子seo
  • discuz网站备份付费内容网站
  • 中信建设有限责任公司重庆沿江高速公路总承包部信息流优化师培训机构
  • 昆明做网站的凡科建站的优势
  • 做娱乐网站sem竞价培训