- 首先开启MySQL
service mysql start
- 修改权限:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION; FLUSH PRIVILEGES;
- 虚拟机网络设置成桥接模式。
- 然后查看Ubuntu 的IP地址,即Python写代码要访问的host,默认端口3306
service mysql start
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION; FLUSH PRIVILEGES;
本文标题:连接虚拟机UbuntuMySQL数据库
本文链接:https://www.haomeiwen.com/subject/hnnvnftx.html
网友评论