创建用户
格式:create user “username”@“host” identified by "password”;
本地登录:create user '用户名'@'localhost' identified by '密码';
某IP登录:create user '用户名'@'某IP' identified by '密码';
所有IP均可登录:create user '用户名'@'%' identified by '密码';
创建数据库:
CREATE DATABASE IF NOT EXISTS jbs_fupu default charset utf8 COLLATE utf8_general_ci;
给用户授权访问某个数据库
grant all privileges on 数据库.* to '用户名'@'%'
查询数据库中每个表的数据量大小
select table_name,sum(DATA_LENGTH)+sum(INDEX_LENGTH) from information_schema.tables where table_schema='zentao' GROUP BY table_name;
阿里云服务器1折起:https://www.aliyun.com/minisite/goods?userCode=x4mpoaxe