How can I setup a remote connection to MySQL?

Use the MySQL  to grant privileges.

Start the MySQL with this command:

mysql

or:

/usr/local/mysql/bin/mysql

Your shell prompt should now look like this:

mysql>

Run this command:

GRANT ALL PRIVILEGES ON *.* TO USERNAME@IP IDENTIFIED BY "PASSWORD";

USERNAME is the username that you would like to create.
IP is the public IP address of your remote connection. See examples
PASSWORD is the password you would like to use for this username.
You now must flush MySQL’s privileges. Run this command:

FLUSH PRIVILEGES;

Run this command to exit MySQL:

exit;
Host IP examples:

I.P. address or Host value of your remote Internet connection Username Connections matched by entry
corp.domain.com john john, connecting to remote MySQL server from corp.domain.com
corp.domain.com
Any user, connecting to remote MySQL server from corp.domain.com
% john john, connecting from any host
%
Any user, connecting from any host
%.domain.com john john, connecting to remote MySQL server from any host in the domain.com domain
133.155.177.199 john john, connecting to remote MySQL server from the host with IP address 133.155.177.199
133.155.177.% john john, connecting to remote MySQL server from any host in the 133.155.177 class C subnet
133.155.177.0/255.255.255.0 john Same as previous example
 

Gửi phản hồi

Mời bạn điền thông tin vào ô dưới đây hoặc kích vào một biểu tượng để đăng nhập:

WordPress.com Logo

Bạn đang bình luận bằng tài khoản WordPress.com Log Out / Thay đổi )

Twitter picture

Bạn đang bình luận bằng tài khoản Twitter Log Out / Thay đổi )

Facebook photo

Bạn đang bình luận bằng tài khoản Facebook Log Out / Thay đổi )

Google+ photo

Bạn đang bình luận bằng tài khoản Google+ Log Out / Thay đổi )

Connecting to %s

%d bloggers like this: