Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Limit MySQL to localhost only - xampp

i'm hosting some smaller sites/gameservers on a windows server 2008 R2, and now i can see in my connection log that the database is used more than just local hosted stuff, so i want to limit my mysql to localhost only, and i know by doing that i will not be able to use my "Mysql Control Center" but that is why Xammp is here, there have been "PhpMyAdmin" on it from day one. But how do i make the settings so it is only localhost? and my www.mysqlhostsite.com/phpmyadmin.

Things i got:

Windows server 2008 R2
Mysql
Phpmyadmin
xampp
like image 794
Lasse Andersen Avatar asked Dec 09 '12 00:12

Lasse Andersen


People also ask

Is MySQL only local?

By default, the MySQL server listens for connections only from localhost, which means it can be accessed only by applications running on the same host. However, in some situations, it is necessary to access the MySQL server from a remote location.

How do I limit the number of rows in a MySQL table?

In MySQL the LIMIT clause is used with the SELECT statement to restrict the number of rows in the result set. The Limit Clause accepts one or two arguments which are offset and count.

Can we use XAMPP and MySQL together?

With XAMPP in place, you can test projects/modifications before releasing them to the Internet. The MySQL Database forms a vital component of the XAMPP Stack, being one of the most significant features offered by it. With XAMPP, you can use phpMyAdmin to create & use your XAMPP MySQL Database in minutes.


1 Answers

You can limit connections from a specific address (e.g. localhost) with the bind-address option. Configure this in your my.ini file:

[mysqld]
bind-address = localhost

Alternatively, you can force MySQL to use named pipes (a local-only method for connecting):

[mysqld]
bind-address = localhost
skip-networking
enable-named-pipe

Of course, restart the MySQL Service after editing my.ini.

like image 155
Bill Karwin Avatar answered Sep 24 '22 22:09

Bill Karwin