Skip to main content

How to enable remote admin access to MySQL database server?


Follow instructions below:

  1. Login to Plesk and make sure that Allow remote connections from any host option is enabled in Tools & Settings > Database Servers > Settings
  2. Edit my.cnf/my.ini file changing bind-address parameter to:
    bind-address = 0.0.0.0
    Also, make that skip-networking parameter is not defined.
    For Linux:
    /etc/mysql/my.cnf Debian/Ubuntu
    /etc/my.cnf CentOS/CloudLinux/RHEL
    For Windows:
    "%plesk_dir%\MySQL\my.ini" for Plesk databases(port 8306)
    "%plesk_dir%\Databases\MySQL\my.ini" for Clients databases(port 3306)
    After that, restart MySQL server.
  3. Note: For the access to client's MySQL server on Windows, use PHPMyAdmin: Plesk > Tools & Settings > Database Servers - MySQL DB Admin.
  4. Grant the access to remote IP address and login to MySQL. For example, if you want to allow access to database called database for user user with password password and remote IP address 203.0.113.2:
    GRANT ALL ON database.* TO user@'203.0.113.2' IDENTIFIED BY 'password';
    FLUSH PRIVILEGES;
    To create a user that has access to all databases, execute the following query:
    GRANT ALL PRIVILEGES ON *.* TO 'someuser'@'203.0.113.2' IDENTIFIED BY 'password' REQUIRE NONE WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
    FLUSH PRIVILEGES;
    Note: to allow connections from any IP address use ' ' character.
  5. Make sure that MySQL server is listening on the correct IP address.
    For Windows:
    netstat -anp tcp | findstr 8306
    TCP 0.0.0.0:8306 0.0.0.0:0 LISTENING
    netstat -anp tcp | findstr 3306
    TCP 0.0.0.0:3306 0.0.0.0:0 LISTENING
    For Linux:
    # netstat -anp | grep :3306
    tcp 0 0 203.0.113.10:3306 0.0.0.0:* LISTEN 13151/mysqld
  6. Login from the remote server:
    mysql -u someuser -ppassword -h example.com

Popular posts from this blog

How to read or extract text data from passport using python utility.

Hi ,  Lets get start with some utility which can be really helpful in extracting the text data from passport documents which can be images, pdf.  So instead of jumping to code directly lets understand the MRZ, & how it works basically. MRZ Parser :                 A machine-readable passport (MRP) is a machine-readable travel document (MRTD) with the data on the identity page encoded in optical character recognition format Most travel passports worldwide are MRPs.  It can have 2 lines or 3 lines of machine-readable data. This method allows to process MRZ written in accordance with ICAO Document 9303 (endorsed by the International Organization for Standardization and the International Electrotechnical Commission as ISO/IEC 7501-1)). Some applications will need to be able to scan such data of someway, so one of the easiest methods is to recognize it from an image file. I 'll show you how to retrieve the MRZ infor...

How to generate class diagrams pictures in a Django/Open-edX project from console

A class diagram in the Unified Modeling Language ( UML ) is a type of static structure diagram that describes the structure of a system by showing the system’s classes, their attributes, operations (or methods), and the relationships among objects. https://github.com/django-extensions/django-extensions Step 1:   Install django extensions Command:  pip install django-extensions Step 2:  Add to installed apps INSTALLED_APPS = ( ... 'django_extensions' , ... ) Step 3:  Install diagrams generators You have to choose between two diagram generators: Graphviz or Dotplus before using the command or you will get: python manage.py graph_models -a -o myapp_models.png Note:  I prefer to use   pydotplus   as it easier to install than Graphviz and its dependencies so we use   pip install pydotplus . Command:  pip install pydotplus Step 4:  Generate diagrams Now we have everything installed...

Open edX Step-By-Step Production Installation Guide

Get your first Open edX platform up and running with this detailed step-by-step how-to guide that provides detailed instructions on how to build your AWS EC2 Ubuntu Linux server, execute the Open edX native build scripts, and configure your new platform. The first time I installed an instance of Open edX, in many ways I felt like I was on the outside looking in. The project documentation that exists is very good, but, it assumes an extensive knowledge base that, at the time, I lacked. This article attempts to fill in some of the gaps in that knowledge base, and hopefully, make the Open edX platform more accessible. Note: this article references Bash scripts that are located in this Github repository: https://github.com/lpm0073/edx.ginkgo This is a step-by-step fully automated script to stand up a single-server full-stack production-ready instance of Open edX running on an Amazon Web Services (AWS) EC2 (Elastic Compute Cloud — aka virtual server) R3.Large instance (aka 2-cpu ser...