1、设置或修改mysql数据表的自增长id值
MariaDB [database]> ALTER TABLE 表名 AUTO_INCREMENT=需要设置的数值;
注:设置的增长值必须大于当前表已存在的最大数值,否则会失效。若想将自增长初始值重归于1,需清空表。
2、查看所有用户
MariaDB [(none)]> select user,host from mysql.user;
3、查看用户权限
MariaDB [(none)]> show grants for 'user'@'host';
4、删除用户
MariaDB [mysql]> delete FROM user Where User='test' and Host='localhost';
MariaDB [mysql]> flush privileges;
删除账户及权限:
MariaDB [(none)]> drop user 'user'@'%';
MariaDB [(none)]> drop user 'user'@'host';
5、赋予权限及撤销权限
MariaDB [(none)]> grant all privileges on database.table to 'user'@'host';
MariaDB [(none)]> revoke all privileges on database.table to 'user'@'host';
如果不赋予该用户所有权限,可以指定需要赋予的权限,如果有多个,使用逗号隔开,比如:
MariaDB [(none)]> grant select,delete,update,create,drop on database.table to 'user'@'host';