启动MYSQL工具
mysql -u root -p
设置编码
ALTER DATABASE test_db_char
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;
创建用户
CREATE USER 'abc'@'%' IDENTIFIED BY '123456';
授权本地访问权限
grant all privileges on testDB.* to test@localhost identified by '1234';
授权所有地址访问权限
grant all privileges on *.* to 'lidl'@'%' identified by '123456';
刷新授权
flush privileges;