Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

What is default settings in MYSQL for Remote access?

In CentOS the file /etc/my.cnf does not have skip-networking or bind-address. MySQL Version is 5.5, does it mean the server is enabled for remote access?

MySQL restart failed after adding skip-networking and bind-address=127.0.0.1 in my my.cnf file, so how can I disable remote access?

my.cnf

[mysqld]
skip-networking
innodb_file_per_table=1
innodb_file_format=barracuda
innodb_strict_mode=1
default-storage-engine=MyISAM
long_query_time=5
log_slow_queries=ON
thread_cache_size=32
key_buffer_size=64M
table_open_cache=1000
max_connections=300
query_cache_type=2
query_cache_limit=32M
query_cache_size=160M
max_heap_table_size=256M
tmp_table_size=256M
wait_timeout=360
interactive_timeout=360
max_allowed_packet=16M
sort_buffer_size=8M
innodb_buffer_pool_size=256M
innodb_log_file_size=64M
share|improve this question
    
I removed bind-address=127.0.0.1 from my.cnf to restart mysql with out errors. –  user1844933 Jul 2 '13 at 9:51

1 Answer 1

up vote 0 down vote accepted

You will have to resort to removing remote access from the MySQL users themselves.

To find out who has remote access, run this

SELECT user,host from mysql.user
WHERE host NOT IN ('localhost','127.0.0.1');

This will show you everyone that can login to MySQL from specific access points as well as broader network specifications.

You could run the utility mysql_secure_installation which do the following:

  • You can set a password for root accounts.
  • You can remove root accounts that are accessible from outside the local host.
  • You can remove anonymous-user accounts.
  • You can remove the test database (which by default can be accessed by all users, even anonymous users), and privileges that permit anyone to access databases with names that start with test_. (I posted a question and answer about this weird aspect).

UPDATE 2013-07-02 13:11 EDT

I see you have skip-networking in the my.cnf and you removed bind-address=127.0.0.1. I don't think the two options belong together. Why?

The option skip-networking disables TCP/IP. Using 127.0.0.1 as a bind-address implies TCP/IP. The two can never really mix. They are meant to be mutually exclusive. Use one or the other, not both at the same time. This makes sense because when you read the MySQL Documentation for skip-networking and bind-address, one does not mention the other.

share|improve this answer
    
if I use bind-address=127.0.0.1 in my my.cnf file to disable remote access, my MYSQL server is not restarting properly, what may be the reason? Adv thanks –  user1844933 Jul 1 '13 at 15:26
    
Please post the my.cnf into the body of your question. –  RolandoMySQLDBA Jul 1 '13 at 15:34
    
I have been posted my my.cnf –  user1844933 Jul 2 '13 at 9:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.