토요일, 3월 28, 2009

set remote access for mysql

// 잊어버릴까봐 적어둔다.
// ------------------------------------------------------------------------------
http://www.experts-exchange.com/Databases/Mysql/Q_21579987.html
ushastry:
Hi!!!

Identical to above...

To change the password(for root or any user)...

on Linux machine..

[ushastry@mmkserv test]#mysqladmin -uUserName -pOldPassword 'NewPassword'

///remote host is not allowed to connect to this mysql server

{From DOCS}
If the following error occurs when you try to connect from a host other than the one on which the MySQL server is running, it means that there is no row in the user table with a Host value that matches the client host:

Host ... is not allowed to connect to this MySQL server

You can fix this by setting up an account for the combination of client hostname and username that you are using when trying to connect.

If you do not know the IP number or hostname of the machine from which you are connecting, you should put a row with '%' as the Host column value in the user table. After trying to connect from the client machine, use a SELECT USER() query to see how you really did connect. (Then change the '%' in the user table row to the actual hostname that shows up in the log. Otherwise, your system is left insecure because it allows connections from any host for the given username.)

Login to MySQL Server(host on which MySQL Server is running)

[root@mmkserv test]# mysql -usqladmin -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 4.0.20-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> GRANT ALL ON *.* TO 'EdwardPeter'@'%' IDENTIFIED BY '123';
Query OK, 0 rows affected (0.14 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.16 sec)

mysql> \q
Bye


From windows machine...

C:\mysql\bin\>mysql -hhostname -uEdwardPeter -p123
// ------------------------------------------------------------------------------


---
Take the server out of rotation because you cannot hot-patch any file
and drain all requests to it. Then feel free to:

NET STOP COMSYSAPP
kill any remaining dllhost.exe which stubbornly remains
NET START COMSYSAPP

You may want to restart any of your services (W3SVC) that have user
applications using user code in dllhost.exe.
---
Yeah just stopping COMSYSAPP didn't work. Here's what I'm doing next.
Seems to work although seems a litle extreme:

for /F "tokens=2" %i in ('tasklist /M [name of my dll] /FO TABLE /NH')
do taskkill /F /PID %i

It will only kill the dllhosts.exe that are using my dll. So far I
haven't seem any instability from doing this. The next time the dll is
needed seems a new dllhost.exe is fired up.
---

tasklist /FI "IMAGENAME eq dllhost.exe" /M
dllhost /ProcessID:{94195E79-EBA1-4EA6-BA92-901A1491D1A2}


-----
Cheers,
June

댓글 없음:

댓글 쓰기