###前提・実現したいこと
Raspberry PiにあるPython プログラムからvirtualBoxのMysqlへ接続させたいのですが、どのような設定をする必要があるのでしょうか。
python
1import MySQLdb 2 3connection = MySQLdb.connect(host="10.0.2.15",db="bas",user="user",passwd="pass",charset="utf8") 4 5cursor = connection.cursor() 6 7cursor.execute("select * from bass") 8result = cursor.fetchall() 9 10for row in result: 11 print row[0] 12 13cursor.close() 14connection.close() 15
###補足情報(言語/FW/ツール等のバージョンなど)
Raspberry Pi 3
回答1件
あなたの回答
tips
プレビュー