sudo apt-get install mysql-client
mysql -uroot -p123456
mysql远程连接
打开配置文件, 修改绑定
vim /etc/mysql/mysql.conf.d/mysqld.cnf
# bind-address = 127.0.0.1
查看用户权限
# 进入mysql执行, 查看所有用户的登录权限
select user,host from user;
# 加入新用户, 允许远程登录
# ken是用户名, 123456是密码
# 这里的%是指除了localhost以外的host
grant all privileges on *.* to ken@"%" identified by "123456" with grant option;