SpringBoot 访问树莓派上的MySql
1 安装Mysql
跳过
2 开启远程访问(开启3306端口)
2.1修改/etc/mysql/my.cnf 文件 (也可能是 /etc/mysql/mariadb.conf.d/50-server.cnf)
找到bind-address这行,并用#注释掉
#bind-address = 127.0.0.1
保存:wq,退出。输入:sudo service mysql restart,重新启动mysql。
2.2登录mysql,输入下面命令
mysql>grant all privileges on *.* to username@"%" identified by "password";(username一般是root,password是新的密码) mysql> FLUSH PRIVILEGES;
例如:
grant all privileges on *.* to "root"@"%" identified by "123456";
FLUSH PRIVILEGES;