window
linux
安装服务端和客户端 apt install mysql-server mysql-client 进入mysql mysql -uroot -p 输入密码 配置 /etc/mysql/my.cnf bind 127.0.0.1 限制本地访问,需要注释
添加远程访问用户
use mysql; update db set host = '%' where user = '用户名'; (如果写成 host=localhost 那此用户就不具有远程访问权限) flush privileges; grant all privileges on *.* to 'myuser'@'%' identified by 'mypassword' with grant option;