Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Databases»MariaDB»How to Allow Remote Clients to Connect MySQL Server

    How to Allow Remote Clients to Connect MySQL Server

    By RahulAugust 20, 20132 Mins Read

    Many times we faced below issue when try to connect a remote MySQL server from client system and remote client is not allowed to access this MySQL server we faced issue like below.

    Advertisement
    # mysql -h 192.168.1.10 -u root -p
    Enter password:
    [Output]
    
    ERROR 1130 (HY000): Host '192.168.1.12' is not allowed to connect to this MySQL server
    

    This issue is because that, If client system does not have permission to connect MySQL server. By default MySQL server doesn’t allow any remote clients to connect.

    Allow MySQL Client Connection:

    To allow a client system to connect mysql server. Login to remote mysql server using ssh and then login to MySQL server locally. Now use following commands to allow remote client. For example if remote client’s ip is 192.168.1.12 and trying to connect through mysql root account.

    [ Below commands need to run on MySQL Server ]

    # mysql -u root -p
    Enter password:
    
    mysql> GRANT ALL ON *.* to [email protected]'192.168.1.12' IDENTIFIED BY 'new-password';
    mysql> FLUSH PRIVILEGES;
    mysql> quit
    

    You have successfully created a new account in MySQL server to connect from specified client system.

    Let’s try to connect from clients system.

    # mysql -h 192.168.1.10 -u root -p
    
    [Sample Output] 
    Enter password:
    Welcome to the MySQL monitor.  Commands end with ; or g.
    Your MySQL connection id is 27
    Server version: 5.1.69 Source distribution
    
    Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
    
    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.
    
    Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
    
    mysql>
    

    MySQL mysql client
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    (Resolved) MySQL connection error: certificate verify failed

    How to Connect Python with MySQL Database

    Installing MySQL 8.0 on Amazon Linux 2

    How To Install MySQL 8 on Amazon Linux 2

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Error: EACCES: permission denied, scandir (Resolved)
    • How To Install Python 3.11 on Ubuntu 22.04 / 20.04
    • How to Install Python 3.11 on Amazon Linux 2
    • An Introduction to the “./configure” Command: Compiling Source Code in Linux
    • How to Install PHP 8.x on Pop!_OS
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.