갑자기 mysql 외부연결이 안됩니다
잘되던게 윈도우 포멧후에 연결이 안됩니다.
centos6 버전이구요 heidisq로 외부연결 하면,
Can't connect to MySQL server on 'localhost' (10061) 요게 뜨면서 접속이 안됩니다.
/etc/my.cnf 에서 bind=127.0.0.1 부분 주석,주석삭제,0.0.0.0로 변경해봤고 방화벽도 확인해봤는데 마찬가집니다.
이것저것 건들다보니 이젠 쉘상에서
mysql -u root -p 하면 mysql: unknown variable 'datadir=/var/lib/mysql'
뜨면서 로그인도 안됩니다.
참고로
--------------------------------------------------------
]# cd /var/lib/mysql
]# ls -al
total 28748
drwxr-xr-x 6 mysql mysql 4096 May 18 21:36 .
drwxr-xr-x 20 root root 4096 Jan 6 2014 ..
-rw-rw---- 1 mysql mysql 16384 May 18 19:29 aria_log.00000001
-rw-rw---- 1 mysql mysql 52 May 18 19:29 aria_log_control
-rw-rw---- 1 mysql mysql 18874368 May 18 19:29 ibdata1
-rw-rw---- 1 mysql mysql 5242880 May 18 19:29 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 Jan 6 2014 ib_logfile1
-rw-r----- 1 mysql root 2909 Jan 6 2014 mysite.com.err
-rw-rw---- 1 mysql mysql 6 May 18 19:29 mysite.com.pid
drwx--x--x 2 mysql mysql 4096 Jan 6 2014 mysql
srwxrwxrwx 1 mysql mysql 0 May 18 19:29 mysql.sock
-rw-r--r-- 1 root root 14 Jan 6 2014 mysql_upgrade_info
drwx------ 2 mysql mysql 4096 Jan 6 2014 performance_schema
drwx------ 2 root root 4096 May 18 21:36 test
drwx------ 2 mysql mysql 12288 Apr 29 18:17 wordpress
------------------------------------------------------------------
요렇게 뜨고요 wordpress가 데이터정보 인거같습니다.
그리고 my.cnf는 요렇게 나옵니다.
------------------------------------------------------------------
]$ cat /etc/my.cnf
#character-set-server=utf8 datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock #bind-address=127.0.0.1 # optimized my.cnf for MariaDB 5.5.x # by eva2000 # vbtechsupport.com #tmpdir=/home/mysqltmp skip-innodb skip-federated #skip-pbxt #skip-pbxt_statistics skip-archive #skip-name-resolve #old_passwords back_log = 75 max_connections = 300 key_buffer_size = 32M myisam_sort_buffer_size = 32M myisam_max_sort_file_size = 2048M join_buffer_size = 64K read_buffer_size = 64K sort_buffer_size = 128K table_definition_cache = 4096 table_open_cache = 2048 thread_cache_size = 64 wait_timeout = 120 connect_timeout = 10 tmp_table_size = 32M max_heap_table_size = 32M max_allowed_packet = 32M max_seeks_for_key = 1000 group_concat_max_len = 1024 max_length_for_sort_data = 1024 net_buffer_length = 16384 max_connect_errors = 100000 concurrent_insert = 2 read_rnd_buffer_size = 256K bulk_insert_buffer_size = 8M query_cache_limit = 512K query_cache_size = 16M query_cache_type = 1 query_cache_min_res_unit = 2K query_prealloc_size = 262144 query_alloc_block_size = 65536 transaction_alloc_block_size = 8192 transaction_prealloc_size = 4096 default-storage-engine = MyISAM log_warnings=1 slow_query_log=0 long_query_time=1 slow_query_log_file=/var/lib/mysql/slowq.log log-error=/var/log/mysqld.log # innodb settings #innodb_extra_rsegments = 4 innodb_purge_threads=1 innodb_doublewrite = 1 innodb_file_per_table = 1 innodb_open_files = 1000 innodb_data_file_path= ibdata1:10M:autoextend innodb_buffer_pool_size = 48M innodb_additional_mem_pool_size = 32M innodb_log_files_in_group = 2 innodb_log_file_size = 64M innodb_log_buffer_size = 8M innodb_flush_log_at_trx_commit = 2 innodb_thread_concurrency = 0 innodb_lock_wait_timeout=50 innodb_flush_method = O_DIRECT innodb_support_xa=1 # 200 * # DISKS innodb_io_capacity = 100 innodb_read_io_threads = 2 innodb_write_io_threads = 2 # mariadb settings [mariadb] #thread-handling = pool-of-threads #thread-pool-size= 20 #mysql --port=3307 --protocol=tcp #extra-port=3307 #extra-max-connections=1 userstat = 0 key_cache_segments = 1 aria_group_commit = none aria_group_commit_interval = 0 aria_log_file_size = 32M aria_log_purge_type = immediate aria_pagecache_buffer_size = 8M aria_sort_buffer_size = 8M [mariadb-5.5] #ignore_db_dirs= query_cache_strip_comments=0 #innodb_lazy_drop_table=1 innodb_read_ahead = linear innodb_adaptive_flushing_method = estimate innodb_flush_neighbor_pages = 1 innodb_stats_update_need_lock = 0 innodb_log_block_size = 512 log_slow_filter =admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk [mysqld_safe] socket=/var/lib/mysql/mysql.sock log-error=/var/log/mysqld.log #nice = -5 open-files-limit = 8192 [mysqldump] quick max_allowed_packet = 32M [myisamchk] key_buffer = 32M sort_buffer = 16M read_buffer = 16M write_buffer = 16M [mysqlhotcopy] interactive-timeout ---------------------------------------------------------- 몇일째 인터넷 뒤져봐도 해결방법을 모르겠습니다. 뭐가 잘못된거고 어디서부터 손봐야 할까요?
mysql: unknown variable 'datadir=/var/lib/mysql'
소곤소곤
댓글 달기