MySQL常用命令
连接mysql
mysql -h127.0.0.1 -uroot -p123456
显示数据库
show databases;
创建用户
create user 'test'@'%' IDENTIFIED BY '123456';
用户授权
grant all privileges on testdb.* to test@% identified by '123456'; flush privileges;
启用外部连接
GRANT ALL PRIVILEGES ON *.* TO 'upsend'@'%' IDENTIFIED BY 'upsendupsend' WITH GRANT OPTION; flush privileges;
查看用户权限
SHOW GRANTS FOR 'test'@'%'; select host, user from user;