Access denied with remote mysql connector python3 connection - python

Connection problem solved! Leaving for others who may have issue.
Still having problems with bind-address issues
I will state the problem, the loayout context of my system and things I have tried.
Problem: When trying to use mysql connector in a python file i keep getting access denied. I am using Pycharm as my IDE and I have the Mysql connector installed though that.
So I am running Ubuntu Server on a Orale VM on a Windows 10 desktop, it's a bridged connection and I can SSH in from my laptop (LInux Mint)to the server just fine. I am running the program trying to access the DB on the Linux Mint laptop. Local network only using 192.168.0.xxx protocols. All VPN's disabled at this point for now.
So just to state i reinstalled the server last night and I set up fresh users and DB for the user and even granted ALL PRIVILEGES to the user and connections from my connectiong machines.
i set bind address in my mysqld.cnf file to 0.0.0.0 for now.
(when i had it set to my laptop ip it wouldn't bind and would restart until I switched it back)
UFW is set to allow mysql(3306)
Ask all the questions and I will get you answers asap. Please provide commands for me to run if needed and specify if the should be ran on the server or my laptop. Thanks for reading!

Related

08001] Could not create connection to database server. Index 5 out of bounds for length 5 - SQL error

I have suddenly started getting this error in my SQL client, and I really do not understand what's going on.
[08001] Could not create connection to database server. Index 5 out of
bounds for length 5
The app that I am working on is using Laravel 6, running on Homestead. I can still connect to server DBs, however I now cannot connect to any local DBs. My OS is Ubuntu 20.04 My DB client is Datagrip.
It was working fine until this started, and I haven't changed anything on my OS - I did install the mysql-connector-python package, but in a virtual env. I have uninstalled that and deactivated the venv, but still having the issue.
I am wondering if I've done my virutal env wrong, and the mysql-connector-python package has made an OS change which I'm now unable to fix.
Any help on the matter would be of great help, as I can't find much info about this specific error anywhere.
I was able to connect to the Homestead box using the box's IP Address, default MYSQL port, and the default Homestead DB username and password.
192.168.10.10:3306
username: homestead
password: secret
It should work the same with you as well. I'm also on Ubuntu and using Datagrip.

Pycharm IDE coding on remote server with ssh

I wonder if there is any way to coding python with remote server data and run the python script on remote server with pycharm only installed on my local machine?
The remote server can be access by two ip address (ssh and ftp each), id and password.
But when I try to use pycharm professional project interpreter, there always an error like this (the ip address I used is for ssh):
I know the easiest way is install jupyter notebbok on my remote server, but I don't have permission to do that.

django - Can't connect from remote devices to specific server - connection timed out

I'm aware this question has been asked before but mine is a problem the answers to those questions cannot solve. Whenever I try to access the site through other devices, it just loads forever and then says "this webpage took too long to respond". I have no idea what I am doing wrong.
I've already tried:
Running the command as manage.py runserver 0.0.0.0:8000
Running the command as manage.py runserver 192.168.1.10:8000
Setting ALLOWED_HOSTS to 192.168.1.10
Setting an inbound & outbound rule on the firewall in advanced security
Restarting the computer (because why not)
Downgrading Django to 2.0.0 because I could connect with other devices to a different server running 2.0.0. Didn't work.
And yes, my other devices are definitely on the same network and the local IP address is correct.
I have no idea what else to do. I am able to access the website from my local computer through the local address, but not from other devices. What am I doing wrong?
I'm running Django 2.0.7.
EDIT: I am able to connect to a different server, but for some reason not this one. I checked if it was the difference in versions that mattered but it didn't (that server ran 2.0.0, which also produced the same problem in this server).

Connect remote server to spyder for running Python Code

Here is what I am trying to do. I have a Windows VM and another Linux VM which is used as server. I have Spyder installed on my Windows VM and would like to run my Python code in Spyder on remote Linux server.
I did try using option in Spyder called "Connect to remote kernel" but it did not work and I am getting error "Could not open ssh tunnel ; Paramiko not available". I was using username#servername:22 for making ssh connection. Needless to say, I am able to ssh the machine using putty but not using Spyder. Any ideas how should I fix this?
I found another way to make a connection to an external server, here is the link explaining step by step.
Basically, you have to connect your client PC to the server through a PuTTY SSH tunnel, it will allow to redirect the client ports to the correct ipython kernel server ports.

Django tutorial: problems accessing development server

I am going through the Django tutorial and am running into problems when trying to view my webpage. I am at the very beginning of the tutorial when I first run the command python manage.py runserver xxx.xxx.xxx.xxx:8000 (replace the x's with my remote server's IP). When I try to navigate to http://xxx.xxx.xxx.xxx:8000 on my local machine, Chrome gives me the error ERR_CONNECTION_REFUSED. I have also tried running the server on 0.0.0.0:8000 and the same issue persists. The port is definitely open and there are no firewalls blocking it - when I plug in my IP and 8000 into this site it claims it is open: http://ping.eu/port-chk/.
I get no error messages on my console from the Django side of things. What could be causing this error? I really don't know much about servers or ports. Thanks in advance.
I am on a virtual Linux server running CentOS 6.4. My local machine is running Mac OS 10.9.5
EDIT:
When I run netstat --listen, port 8000 doesn't show up in the Local Address column, even though my Django dev server claims to be running. Someone mentioned to me that this means my application is not listening on this port. What does this mean and how do I remedy it?
EDIT:
I can access the page through my phone's internet with no issues. What gives?
If you're running Django inside a VM but accessing it from the host Mac, you'll need to forward the port. See the settings in Virtualbox/VMWare/whatever.
Note however that Django runs perfectly well directly on a Mac, so if you're just learning it may be simpler to just install it there.
Don't issue no IP, runserver will tell you where you can connect to when launching it.
Since you're launching it from your VM, you might supply the IP.
Ensure system level routing is okay.
Add your host local IP to the ALLOWED_HOSTS setting.

Categories