@Turbocapitalist
No, I need to collect the student data from my laptop.
My Python uses pymysql and openpyxl together, collects the data, writes it to Excel in about 2 seconds for 200 + students!
Thanks for the tip! I like this ssh tunneling!
But could I run my Python data collector through that?
Just in case anyone else has this problem, a solution:
This way is probably not so secure, with 3306 open, but a) I only have homework b) you still need the user name and password. There is a more secure way using mysql rsa key encryption I read. Maybe do that later, right now, I just need it working.
ssh to your cloud server.
First, open port 3306 on the cloud server.
Quote:
sudo ufw allow 3306
sudo ufw enable
|
Check if you like:
When you create a user on mysql as root, it looks something like this, also when you do it via ssh on the server:
Quote:
CREATE USER 'peter'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON some_db.* TO 'peter'@'localhost';
|
If you want remote access, you need to change the user data (or make a new, remote user):
Quote:
RENAME USER 'peter'@'localhost' TO 'peter'@'%';
GRANT ALL ON somedb.* TO 'peter'@'%';
FLUSH PRIVILEGES;
|
% here apparently represents any ip
Then on the also via ssh on the server (Ubuntu uses nano mostly, there are other editors):
Quote:
sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
|
find the line that has
change this to
ctrl X to quit nano, nano asks if you want to save, press y, then enter to save in the same place you opened /etc/mysql/mysql.conf.d/mysqld.cnf
Then (on the server):
Quote:
sudo systemctl restart mysql
|
After that, my Python data collector using pymysql worked fine from the Idle shell.
Like many set-up things, once you have done it a couple of times, it looks easy! But the first time!