MySQL数据库修改一列内容

1.如何修改MySQL数据库表:使用“ALTERTABLE”语句改变原表的结构,如添加字段或删除字段、修改原字段的数据类型、重命名字段或表、修改表字符等.;语法“可变表名称[修改选项]”。

2.以系统管理员身份登录Windows。
停止MySQL服务。

3.更新群组名称=张三其中性别=男将性别为男的人员姓名更改为张三。

mysql常用命令,授权和撤销操作

允许数据库名称。
用户权限的数据库表:insert为添加,delete为删除,select为检查,update为更改,create为创建,drop为删除。
示例:grantselectorosrtxhk表示授予用户数据库的查询权限,对于xhk用户可以在用户地址后添加@'ip。
例如“通过‘密码’识别”。
tifyby'123456'表示将所有数据库的所有权限授予用户xhk,允许用户xhk远程登录IP地址127.0.0.1,并将用户密码设置为123456。
刷新权限:flushprivileges//授权完成后,必须刷新权限才能生效:普通用户一般增删改查修改:grantselecttest.*toxhk@'%'//表示对下所有表的查询权限测试数据库。
xhkaregranttotheusergrantinsertontest.usertoxhk@'%'//表示将test数据库下用户表的查询权限授予xhk用户,索引、视图、存储过程、函数等权限:grantcreateontest.*toxhk@'192.168.0.%'grantalterontest.*toxhk@'192.168.0.%'grantdropontest.*toxhk@'192.168.0.%'//192.168.0.%表示允许远程连接的IP地址,如果不想限制IP地址。
想要链接,设置为“%”,可以grantallprivilegesontestdbtodba@'localhost'其中关键字“privilege”可以省略是。
grantallon*.*todba@'localhost'grantselecton*.*todba@localhost;--dba可以查询MySQL中所有数据库中的表。
grantallon*.*todba@localhost;--dba可以管理MySQL中的所有数据库grantsselectontestdb.*todba@localhost;--testdb中的dba可以查询表。
grantselect,insert,update,deletetestontestdb.apache_logtodba@localhost;grantexecuteonproceduretestdb.pr_addto'dba'@'localhost';grantexecuteonfunctiontestdb.fn_addto'dba'@'localhost';showgrants;showgrantsfordba@localhost;revokeallon*.*fromdba@localhost;Grant,撤销用户权限后,重新连接MySQL数据库才使用户权限生效。
grantselectontestdb.*todba@localhostwithgrantoption;此功能不常用。
实践中,数据库权限最好由DBA统一管理。