新建一个数据库:
create database gh4ai
执行一个写好的文件:
use gh4ai; source task.sql;
上图的use,每次都要使用。
新建用户
CREATE USER 'local'@'localhost' IDENTIFIED BY '123456'; CREATE USER 'test'@'%' IDENTIFIED BY '123456';
授权
grant select,update on gh4ai.* to 'test'@'%' identified by '123456';
删除用户:
drop user 'test'@’%’;
使用哪个端口
show global variables like 'port';