Connecting MySQL 5.1 container with python Error
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 25/100
調査の方向性
Start with cell 20 of the referenced jazz_final_db_migration.ipynb and compare its mysql.connector.connect call with the Docker run command for jazz_db. Verify the container's published port, credentials, and connection error, then document a reproducible connection and database-creation procedure as the done state.
索引モデルが issue の本文から書いたものです。
説明
sudo docker pull vsamov/mysql-5.1.73
Using default tag: latest
latest: Pulling from vsamov/mysql-5.1.73
30d541b48fc0: Pull complete
8ecd7f80d390: Pull complete
46ec9927bb81: Pull complete
2e67a4d67b44: Pull complete
7d9dd9155488: Pull complete
0b0a5e453b33: Pull complete
e8a67e96f27e: Pull complete
1a233fe4e788: Pull complete
679cc5f63dfc: Pull complete
cb730efe6d35: Pull complete
7d5b1100bc65: Pull complete
Digest: sha256:ef03d57334761ca1e3d93cbd9f83ee1f93dafd7cac74203fbf97f20ac098c82b
Status: Downloaded newer image for vsamov/mysql-5.1.73:latest
docker.io/vsamov/mysql-5.1.73:latest
sudo docker run -d --name jazz_db -p 3307:3306 -e MYSQL_ROOT_PASSWORD=12345 vsamov/mysql-5.1.73:latest
c2913eb089d3ac553c8547d99145ddd668424434ce144ae322c5c849924419a4
sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c2913eb089d3 vsamov/mysql-5.1.73:latest "/entrypoint.sh mysq…" 12 seconds ago Up 8 seconds 0.0.0.0:3307->3306/tcp, :::3307->3306/tcp jazz_db
I have installed a sql container using the above procedure. Now i want to connect it to python and create a new database. I used mysql-python-connector
import mysql.connector
db = mysql.connector.connect(
host="localhost", # or use the IP of your Docker host machine
port=3307, # the port you mapped for the container (3307 in your case)
user="root",
password="12345"
)
It is resulting in this error:
MySQLInterfaceError Traceback (most recent call last)
File ~/anaconda3/envs/etl/lib/python3.10/site-packages/mysql/connector/connection_cext.py:308, in CMySQLConnection._open_connection(self)
307 try:
--> 308 self._cmysql.connect(**cnx_kwargs)
309 self._cmysql.converter_str_fallback = self._converter_str_fallback
MySQLInterfaceError: Access denied for user 'root'@'172.17.0.1' (using password: NO)
The above exception was the direct cause of the following exception:
ProgrammingError Traceback (most recent call last)
/home/aidev/VectraCom/db_migration/jazz_final_db_migration.ipynb Cell 20 line 1
----> 1 db = mysql.connector.connect(
2 host="localhost", # or use the IP of your Docker host machine
3 port=3307, # the port you mapped for the container (3307 in your case)
4 user="root",
5 password="12345"
6 )
File ~/anaconda3/envs/etl/lib/python3.10/site-packages/mysql/connector/pooling.py:293, in connect(*args, **kwargs)
290 raise ImportError(ERROR_NO_CEXT)
292 if CMySQLConnection and not use_pure:
--> 293 return CMySQLConnection(*args, **kwargs)
294 return MySQLConnection(*args, **kwargs)
...
314 msg=err.msg, errno=err.errno, sqlstate=err.sqlstate
315 ) from err
317 self._do_handshake()
ProgrammingError: 1045 (28000): Access denied for user 'root'@'172.17.0.1' (using password: NO)
- 主要言語
- JavaScript
- スター
- 3.1k
- フォーク
- 6.4k
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
docker/getting-started のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
docker/getting-started#481 · コメント 2 件 · リアクション 5 件 ·
-
難易度 1/5 1〜3時間 初心者へのやさしさ 65/100
docker/getting-started#394 · コメント 1 件 · リアクション 3 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
docker/getting-started#494 ·
-
Chat オープン
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
docker/getting-started#482 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 1/100
docker/getting-started#477 ·
docker/getting-started の issue をすべて見る
似ている issue
-
Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
Automattic/safe-publish#594 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
dream-num/dsh-univer-office#104 ·
-
comp/dashboard invalid P3
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
NousResearch/hermes-agent#121143 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
avniproject/avni-webapp#1811 ·
-
area/auroraboot area/webui bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100