2.1 将localhost连接改为可以远程连接
–登陆
mysql -uroot -p;
–将root的host改为%,就可以在其他电脑用ip连接。
use mysql;
select user,host from user;
update user set host = ‘%’ where user = ‘root’;
ALTER USER ‘root’@’%’ IDENTIFIED BY ‘password’ PASSWORD EXPIRE NEVER;
ALTER USER ‘root’@’%’ IDENTIFIED WITH mysql_native_password BY ‘root’;
2.2 mysql建表空间,用户,授权
–建表空间,设置编码
create database flybi default character set utf8 collate utf8_bin;
–创建用户
create user flybi identified by ‘flybi’;
–授权
grant all on flybi.* to ‘flybi’@’%’ ;
grant all privileges on flybi.* to flybi@localhost identified by ‘flybi’;
grant select,insert,update,delete,create,drop on vtdc.employee to flybi identified by ‘flybi’;