-3
connection = mysql.connector.connect(
            host=ip,
            user=user,
            password=password)

Hello. I use mysql-connector-python https://pypi.org/project/mysql-connector-python When i run this code on my PC everything fine (Python 3.12) But when i try to execute this on other PC, it gives me this error RuntimeError: Failed raising error

BUT. when i change the ip to 127.0.0.1 or just not neccessary ip it gives just an error that i type wrong host.

I tried to execute this on different python version since 3.10 to 3.13 and on 3.10 it said Process finished with exit code -1073741819 (0xC0000005)

I use Pycharm

I tried to change python versions, start pycharm with admin rights, reinstall libary

(Update) When i use venv from other project, everything works fine

5
  • What is the value of ip in your PC? Commented Dec 21, 2024 at 23:16
  • @YannisP. 31.128.37.77 Commented Dec 22, 2024 at 6:37
  • When running this code on your PC, don't you set ip=127.0.0.1? Commented Dec 23, 2024 at 16:14
  • The RuntimeError can also be many things. I am not sure we can help you, but try posting the full message that is printed when you run the script. Edit your message and add the full error message. Commented Dec 23, 2024 at 16:17
  • @YannisP. can this error be because of cirilic symbols in system folders? Commented Dec 24, 2024 at 12:46

1 Answer 1

0

Reason was that i installed Python at path with cirilic symbols, when i installed it at other path, everything started work fine

Update: It didn't fix error so i started dig further. I found through Event Viewer in windows that there's a problem with file MSVCP140.dll.

This file associated with VCRedist C++. I downloaded last verison https://learn.microsoft.com/ru-ru/cpp/windows/latest-supported-vc-redist?view=msvc-170 and finaly handled this error

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.