Loading...
MySQL 9.5 Reference Manual 9.5의 2.9.3 Testing the Server의 한국어 번역본입니다.
아래의 경우에 피드백에서 신고해주신다면 반영하겠습니다.
감사합니다 :)
data directory가 초기화되고 서버를 시작한 후, 서버가 만족스럽게 동작하는지 확인하기 위해 몇 가지 간단한 테스트를 수행합니다. 이 절에서는 현재 위치가 MySQL 설치 디렉터리이고 그 안에 여기에서 사용하는 MySQL 프로그램들이 들어 있는 bin 하위 디렉터리가 있다고 가정합니다. 그렇지 않은 경우, 명령의 경로 이름을 그에 맞게 조정하십시오.
또는 bin 디렉터리를 PATH 환경 변수 설정에 추가하십시오. 그러면 셸(커맨드 인터프리터)이 MySQL 프로그램을 올바르게 찾을 수 있어, 프로그램의 경로 이름이 아니라 이름만 입력하여 실행할 수 있습니다. Section 6.2.9, “Setting Environment Variables”를 참조하십시오.
mysqladmin을 사용하여 서버가 실행 중인지 확인합니다. 다음 명령들은 서버가 올라와 있고 연결에 응답하는지 확인하기 위한 간단한 테스트를 제공합니다:
1$> bin/mysqladmin version 2$> bin/mysqladmin variables
서버에 연결할 수 없으면, root로 연결하기 위해 -u root 옵션을 지정하십시오. 이미 root 계정에 패스워드를 설정한 경우, 커맨드 라인에 -p도 지정하고, 프롬프트가 나타나면 패스워드를 입력해야 합니다. 예:
1$> bin/mysqladmin -u root -p version 2Enter password: (enter root password here)
mysqladmin version의 출력은 사용하는 플랫폼과 MySQL 버전에 따라 약간 달라지지만, 다음과 비슷해야 합니다:
1$> bin/mysqladmin version 2mysqladmin Ver 14.12 Distrib 9.5.0, for pc-linux-gnu on i686 3... 4 5Server version 9.5.0 6Protocol version 10 7Connection Localhost via UNIX socket 8UNIX socket /var/lib/mysql/mysql.sock 9Uptime: 14 days 5 hours 5 min 21 sec 10 11Threads: 1 Questions: 366 Slow queries: 0 12Opens: 0 Flush tables: 1 Open tables: 19 13Queries per second avg: 0.000
mysqladmin으로 수행할 수 있는 다른 작업을 보려면, --help 옵션을 지정하여 실행하십시오.
서버를 종료할 수 있는지 확인합니다 (root 계정에 이미 패스워드가 있는 경우 -p 옵션을 포함):
1$> bin/mysqladmin -u root shutdown
서버를 다시 시작할 수 있는지 확인합니다. 이를 위해 mysqld_safe를 사용하거나 mysqld를 직접 실행합니다. 예:
1$> bin/mysqld_safe --user=mysql &
mysqld_safe가 실패하면, Section 2.9.2.1, “Troubleshooting Problems Starting the MySQL Server”를 참조하십시오.
서버에서 정보를 가져올 수 있는지 확인하기 위해 몇 가지 간단한 테스트를 실행합니다. 출력은 여기에서 보이는 것과 유사해야 합니다.
mysqlshow를 사용하여 어떤 데이터베이스가 존재하는지 확인합니다:
1$> bin/mysqlshow 2+--------------------+ 3| Databases | 4+--------------------+ 5| information_schema | 6| mysql | 7| performance_schema | 8| sys | 9+--------------------+
설치된 데이터베이스 목록은 달라질 수 있지만, 최소한 mysql과 information_schema는 항상 포함합니다.
데이터베이스 이름을 지정하면, mysqlshow는 해당 데이터베이스 내 테이블 목록을 표시합니다:
1$> bin/mysqlshow mysql 2Database: mysql 3+---------------------------+ 4| Tables | 5+---------------------------+ 6| columns_priv | 7| component | 8| db | 9| default_roles | 10| engine_cost | 11| func | 12| general_log | 13| global_grants | 14| gtid_executed | 15| help_category | 16| help_keyword | 17| help_relation | 18| help_topic | 19| innodb_index_stats | 20| innodb_table_stats | 21| ndb_binlog_index | 22| password_history | 23| plugin | 24| procs_priv | 25| proxies_priv | 26| role_edges | 27| server_cost | 28| servers | 29| slave_master_info | 30| slave_relay_log_info | 31| slave_worker_info | 32| slow_log | 33| tables_priv | 34| time_zone | 35| time_zone_leap_second | 36| time_zone_name | 37| time_zone_transition | 38| time_zone_transition_type | 39| user | 40+---------------------------+
mysql 프로그램을 사용하여 mysql 스키마의 테이블에서 정보를 조회합니다:
1$> bin/mysql -e "SELECT User, Host, plugin FROM mysql.user" mysql 2+------+-----------+-----------------------+ 3| User | Host | plugin | 4+------+-----------+-----------------------+ 5| root | localhost | caching_sha2_password | 6+------+-----------+-----------------------+
이 시점에서 서버는 실행 중이며 접근할 수 있습니다. 아직 초기 계정에 패스워드를 설정하지 않았다면, 보안을 강화하기 위해 Section 2.9.4, “Securing the Initial MySQL Account”의 지침을 따르십시오.
mysql, mysqladmin, mysqlshow에 대한 자세한 내용은 Section 6.5.1, “mysql — The MySQL Command-Line Client”, Section 6.5.2, “mysqladmin — A MySQL Server Administration Program”, Section 6.5.6, “mysqlshow — Display Database, Table, and Column Information”을 참조하십시오.
2.9.2 Starting the Server
2.9.4 Securing the Initial MySQL Account