Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection problem #67

Open
alphanumericaltycoon opened this issue Aug 3, 2021 · 8 comments
Open

Connection problem #67

alphanumericaltycoon opened this issue Aug 3, 2021 · 8 comments

Comments

@alphanumericaltycoon
Copy link

OS: Kali Linux

Hi,

I am getting the below error. Any advice on how I can fix it? Thanks

`┌──(kali㉿kali)-[~/Automatic-Youtube-Reddit-Text-To-Speech-Video-Generator-and-Uploader/YouTube Bot Server]
└─$ python3 initserver.py 1 ⨯
Found config.ini
Traceback (most recent call last):
File "/home/kali/.local/lib/python3.9/site-packages/mysql/connector/network.py", line 509, in open_connection
self.sock.connect(sockaddr)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/kali/Automatic-Youtube-Reddit-Text-To-Speech-Video-Generator-and-Uploader/YouTube Bot Server/initserver.py", line 65, in
init()
File "/home/kali/Automatic-Youtube-Reddit-Text-To-Speech-Video-Generator-and-Uploader/YouTube Bot Server/initserver.py", line 46, in init
socketserverhandler.startServer()
File "/home/kali/Automatic-Youtube-Reddit-Text-To-Speech-Video-Generator-and-Uploader/YouTube Bot Server/socketserverhandler.py", line 17, in startServer
database.beginDataBaseConnection()
File "/home/kali/Automatic-Youtube-Reddit-Text-To-Speech-Video-Generator-and-Uploader/YouTube Bot Server/database.py", line 290, in beginDataBaseConnection
connection_pool = pooling.MySQLConnectionPool(
File "/home/kali/.local/lib/python3.9/site-packages/mysql/connector/pooling.py", line 159, in init
self.add_connection()
File "/home/kali/.local/lib/python3.9/site-packages/mysql/connector/pooling.py", line 270, in add_connection
cnx = MySQLConnection(**self._cnx_config)
File "/home/kali/.local/lib/python3.9/site-packages/mysql/connector/connection.py", line 95, in init
self.connect(**kwargs)
File "/home/kali/.local/lib/python3.9/site-packages/mysql/connector/abstracts.py", line 716, in connect
self._open_connection()
File "/home/kali/.local/lib/python3.9/site-packages/mysql/connector/connection.py", line 206, in _open_connection
self._socket.open_connection()
File "/home/kali/.local/lib/python3.9/site-packages/mysql/connector/network.py", line 511, in open_connection
raise errors.InterfaceError(
mysql.connector.errors.InterfaceError: 2003: Can't connect to MySQL server on 'localhost:3306' (111 Connection refused)
Safe Exit

@iatenine
Copy link

iatenine commented Sep 3, 2021

Did you provide the MySql login credentials to the appropriate fields within settings.py (database_host, database_user, database_password)?

@LavaB0Y
Copy link

LavaB0Y commented Sep 6, 2021

iatenine, how do I do that? because when I try to run it, it just returns nothing back and starts from a new line.

@stratty7
Copy link

stratty7 commented Sep 6, 2021

If you have setup MySQL correctly then in settings.py you need to set

database_host = "" database_user = "" database_password = ""
to the login details to MySQL. Default should be:

database_host = "localhost" database_user = "root" database_password = " "

But depending how you have setup it may be different.

@LavaB0Y
Copy link

LavaB0Y commented Sep 6, 2021

startty, Yeah that's the thing I have no idea how to set that in settings.py as I wrote above it just return nothing back, is there a specific way to start it?

@stratty7
Copy link

stratty7 commented Sep 6, 2021

Edit settings.py and make those changes I commented above. Then go and run initserver.py.

@LavaB0Y
Copy link

LavaB0Y commented Sep 6, 2021

I tried some stuff and now it seems to kinda work, thanks, but now when I run init.py a Login page pops up and no matter what I type in, be it the root and password or my reddit name and reddit password it sends back "Socket Broken!" in cmd , what do I do?

@iatenine
Copy link

iatenine commented Sep 6, 2021

You need to delete config.ini every time you change settings.py. Otherwise the code block to create it doesn't execute and you'll be stuck with the original settings the first time you ran initserver.py

@LavaB0Y
Copy link

LavaB0Y commented Sep 7, 2021

iatenine, I tried it and it still doesn't work. Where do I have to input this username and password? because I did that already, many times even changing my reddit password and it still doesn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants