标签:exit rename string client 用户名 修改 creat 远程访问 服务端
apt install mysql-server
sudo apt install mysql-client
sudo apt install libmysqlclient-dev
sudo netstat -tap | grep mysql
vim /etc/mysql/mysql.conf.d/mysqld.cnf
注释掉bind-address = 127.0.0.1:
mysql-uroot-p
GRANT ALL PRIVILEGES ON *.* TO
‘root‘
@
‘%‘
IDENTIFIED BY
‘你的密码‘
WITH GRANT OPTION;
flush privileges;
客户端安装mysql:
apt install mysql-client
查看帮助文档:
mysql --help
连接到mysql
mysql -uroot -p
退出:
exit
创建用户:create usr ‘用户名‘@‘IP地址‘ identified by ‘密码‘;
删除用户:drop user ‘用户名‘@‘IP地址‘;
修改用户:rename user ‘用户名‘@‘IP地址‘; to ‘新用户名‘@‘IP地址‘;
修改密码:set password for ‘用户名‘@‘IP地址‘ = Password(‘新密码‘)
授权:grant 权限 on 数据库.表 to ‘用户‘@‘IP地址‘
取消权限:revoke 权限 on 数据库.表 from ‘用户‘@‘IP地址‘
查看权限:show grants for ‘用户‘@‘IP地址‘
IP段支持通配符:%:如192.168.60.%
标签:exit rename string client 用户名 修改 creat 远程访问 服务端
原文地址:https://www.cnblogs.com/WeiKing/p/10926623.html