본문 바로가기

리눅스

[mysql] 원격서버(clinet)에 설치되어 있는 MySQL Server로 접속하기

반응형

원격서버(clinet)에 설치되어 있는 MySQL Server로 접속하기

 

[Client 192.168.0.100]
[root@kingdom bin]# ./mysql -u scbyun -p first -h 192.168.0.50 -P 3306
Enter password:
ERROR 1130 (HY000): Host '192.168.0.100' is not allowed to connect to this MySQL server
[root@kingdom bin]#

 

[MySQL Server 192.168.0.50]
- 특정 IP(192.168.0.100)만 OPEN

mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON first.* TO 'scbyun'@192.168.0.100 IDENTIFIED BY '12345';
- ANY OPEN
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON first.* TO 'scbyun'@"%" IDENTIFIED BY '12345';

 

[Client 192.168.0.100]
[root@kingdom bin]# ./mysql -u scbyun -p first -h 192.168.0.50 -P 3306
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 16
Server version: 5.0.77 Source distribution

 

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

 

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

 

mysql>

 

 


 

 

728x90
반응형