Connect to MySQL Database on Local Network

后端 未结 5 1931
迷失自我
迷失自我 2020-12-17 06:08

I actually thought I could do this until I tried. I installed MySQL server on one PC in the Local network IP Address (192.168.1.4) and now I am trying to access it from anot

相关标签:
5条回答
  • 2020-12-17 06:37

    For all users and all host.

    mysql -u root -p
    
    GRANT ALL PRIVILEGES
    ON *.*
    TO '%'@'%'
    IDENTIFIED BY 'password'
    WITH GRANT OPTION;
    
    FLUSH PRIVILEGES;
    
    QUIT;
    
    0 讨论(0)
  • 2020-12-17 06:41

    You need to have proper permissions to connect. In the computer that has the DB installed, give your user the proper permissions:

    mysql>GRANT ALL PRIVILEGES ON *.* TO 'domico'@'DOMICO-PC';
    mysql>FLUSH PRIVILEGES;
    

    You can read more here: https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql

    And here: https://dev.mysql.com/doc/refman/5.1/en/privileges-provided.html

    0 讨论(0)
  • 2020-12-17 06:45

    You need to give permissions to connect from remotehost

    mysql>GRANT ALL PRIVILEGES ON database.* TO 'username'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;

    0 讨论(0)
  • 2020-12-17 06:55

    creata a new user by mysql server and give it privileges you can do it by command and by using any server e.g by using workbench

    0 讨论(0)
  • 2020-12-17 07:02

    This is connecting to the intended host as you require it to. t is just stating who is connecting. and where from.

    USER@DOMAIN

    user : your user running the mysql command domain : name of the system you are connecting from.

    Log into mysql via the server using -u root, ensure the user 'domico' is created and has sufficient access.

    0 讨论(0)
提交回复
热议问题