Jump to content

Recommended Posts

Posted

You're on Tommy now. I have increased your storage to the maximum, and you don't need to log in to cpanel to keep your account active until 2021-04-12. Let us know if there is anything else we can help you with. Thank you so much for your donation!

Posted

You're on Tommy now. I have increased your storage to the maximum, and you don't need to log in to cpanel to keep your account active until 2021-04-12. Let us know if there is anything else we can help you with. Thank you so much for your donation!

 

Thanks!

 

I had previously installed ZeroSSL certificates when I was on Johnny. Now that I can use AutoSSL, what do I need to do to have my main domain use AutoSSL? Do I just need to delete the old one and then will the SSL/TLS Status page give me the option to renew using AutoSSL?

 

SSL Certificates on Server:

post-196318-0-05266500-1602620518_thumb.jpg

 

 

SSL/TLS Status page:

post-196318-0-32453400-1602620131_thumb.jpg

 

Posted

Yes, if the certificate is deleted autossl will issue a new one for you. It can sometimes take up to 24 hours to run. If it still isn't working after 24 hours let us know and we can take a look.

Posted

Yes, if the certificate is deleted autossl will issue a new one for you. It can sometimes take up to 24 hours to run. If it still isn't working after 24 hours let us know and we can take a look.

 

Thanks!

 

Also I just noticed one of the python scripts that I planned on using to make Admin reports from the MySQL database is no longer working.

It looks like it's because the python3 mysql-connector v: 2.2.9 is not installed.

 

Just took a few hours, but I was able to get it to work using mysqlclient package.

Is there any chance to get the mysql-connector package on Tommy? It seems much easier to work with.

Posted

I actually intended to only install mysqlclient on all of our servers as it has the highest performance https://stackoverflow.com/a/46396881/2336864 I'm not even sure how mysql-connector got installed. It must have been a dependency of something else and I didn't notice.

 

If it's really 10 times faster, then you can't really argue with that.

 

I'm sure I just need to do some more research, but the annoying part of using the mysqlclient is for some reason it keeps returning all my VARCHAR objects as a byte literal like below:

 

name as byte literal: b'joe'

name as byte literal: b'bob'

name as byte literal: b'Alex'

 

In order to make it output it as a string, which the mysql-connector did by default, I have to do this:

 

for row in results:
    id = row["id"].decode("UTF-8") #have to add .decode("UTF-8") at end of every object I want as a string.
    # using str(id) still outputs as a byte literal with the 'b in front of string.
    name = row["name"].decode("UTF-8")
    state = row["state"].decode("UTF-8")
    print( "id: "+id+" name: " + name + " state: " +state )
    print("<br>")
#

 

Maybe someone has some idea how to fix this when I'm making the connection to the db. I see something in the documentation about converter, but haven't found a detailed explanation on how to use it or if it would even work to convert VARCHAR to python string.

Not to mention, many of the mysqlclient python tutorials I've found are using the Cursor object, which doesn't work with mysqlclient.

 

Also with mysql-connector I was able to elegantly use a for loop to access the results in a dictionary like this.

 

 

for (id, name, state) in results:
    print("id: "+str(id)+" name: " + name + " state: " +state+"<br>")
#

 

Hopefully I can figure out how to do that with mysqlclient.

Before, I was unable to test mysqlclient in either windows or CygWin terminal because it wanted Visual Studio Build tools installed.

So I tried that and still didn't work, but I was able to install it using a prebuilt binary wheel.

So now I can hopefully figure things out without having to test it on the server by constantly uploading files via FTP and reloading the python script.

Posted

The reason mysqlclient is so much faster is because it's written in C and then compiled into an executable. Mysql-connector is 100% python so it is much slower.

 

Here is a link I found that may help. I haven't read through it completely myself so I don't know if they will answer your questions for sure. I did notice it mentions cursors though.

 

https://mysqlclient.readthedocs.io/

Posted

The reason mysqlclient is so much faster is because it's written in C and then compiled into an executable. Mysql-connector is 100% python so it is much slower.

 

Here is a link I found that may help. I haven't read through it completely myself so I don't know if they will answer your questions for sure. I did notice it mentions cursors though.

 

https://mysqlclient.readthedocs.io/

 

Thanks for all your help!

 

I was able to get it to work very similar to how I had it before. It was with how I was importing MySQLdb. I was only importing the _mysql module.

 

Now I can use the cursor object, and no need to decode byte literals or anything. Now it's working perfectly. Thanks again.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...