Unkown server host error

Hi, I’m coding an webapp with Flask and I’m having problems with MySQL host, when I run my project and try to use the database I get this error:

“MySQLdb.OperationalError: (2005, “Unknown server host ‘sql208.infinityfree.com’ (11001)”)”

Here’s my code:

from flask import Flask
from flask_mysqldb import MySQL


mysql = MySQL()

def create_app():
    app = Flask(__name__)
    app.config['SECRET_KEY'] = 'csb_basquete'
    
    app.config['MYSQL_HOST'] = 'sql208.infinityfree.com'
    app.config['MYSQL_USER'] = 'if0_34469445'
    app.config['MYSQL_PASSWORD'] = 'rembymod'
    app.config['MYSQL_DB'] = 'if0_34469445_csb'


    from .views import views
    from .auth import auth

    app.register_blueprint(views, url_prefix='/')
    app.register_blueprint(auth, url_prefix='/')

    mysql.init_app(app)

    return app

Where’s the error?

When executed from the local:
InfinityFree doesn’t allow remote sql connections.So your request simply can’t be completed.

When executed from the server:
No,you can’t even run python on this hosting.

Both of the function(Remote sql/Python support) are available in the premium hosting.If you need those functions so badly then consider upgrading.

7 Likes

Thanks man. Didn’t know about that

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.