programing

PhphStorm을 통해 MariaDB에 연결할 수는 없지만 터미널은 정상적으로 작동합니다.

telecom 2023. 10. 17. 20:00
반응형

PhphStorm을 통해 MariaDB에 연결할 수는 없지만 터미널은 정상적으로 작동합니다.

왜 PphStorm이 내 데이터베이스에 연결되지 않는지 알 수가 없습니다.명령줄과 동일한 자격 증명을 사용하고 있습니다.

MariaDB는 Docker 아래에서 실행되고 있습니다. 그것이 변화를 가져올지는 확실하지 않습니다.

무엇이 문제일까요?

사용하고 있습니다.mariadb:10.4구성 변경을 최소화한 도커 이미지:

[mysqld]
default_time_zone = '+00:00'
sql_mode            = STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION,NO_UNSIGNED_SUBTRACTION,PAD_CHAR_TO_FULL_LENGTH,NO_AUTO_CREATE_USER

MariaDB는 다음과 같이 구성되어 있습니다.docker-compose.yml:

    mariadb:
        build:
            context: .
            dockerfile: docker/mariadb.docker
        restart: "no" # https://docs.docker.com/compose/compose-file/#restart
        env_file: .env
        volumes:
            - ./docker/20200119_162812.sql.gz:/docker-entrypoint-initdb.d/seed.sql.gz:ro
        ports:
            - '3306:3306'
MariaDB [busman]> \s
--------------
mariadb  Ver 15.1 Distrib 10.4.11-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

Connection id:          10
Current database:       busman
Current user:           root@172.18.0.1
SSL:                    Not in use
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server:                 MariaDB
Server version:         10.4.11-MariaDB-1:10.4.11+maria~bionic mariadb.org binary distribution        Protocol version:       10
Connection:             127.0.0.1 via TCP/IP
Server characterset:    latin1
Db     characterset:    utf8
Client characterset:    utf8
Conn.  characterset:    utf8
TCP port:               3306
Uptime:                 2 min 17 sec

로깅을 추가하려고 했습니다.

command: [mysqld,--general-log=1,--general-log-file=/var/log/mysql/general-log.log]

터미널을 통해 연결하면 여러 가지 정보가 쏟아집니다.

200203  0:56:21     10 Connect  root@172.18.0.1 as anonymous on busman
                    10 Query    SET SQL_SAFE_UPDATES=1,SQL_SELECT_LIMIT=1000,MAX_JOIN_SIZE=1000000                        10 Query    show databases
                    10 Query    show tables
                    10 Field List       billing_items
                    10 Field List       booking_groups
                    10 Field List       booking_segments
                    10 Field List       booking_stops
                    10 Field List       bookings
                    10 Field List       companies
                    10 Field List       company_aliases
                    10 Field List       company_surveys
                    10 Field List       countries
                    10 Field List       country_timezone
                    10 Field List       customers
                    10 Field List       driver_jobs
                    10 Field List       email_cc
                    10 Field List       failed_jobs
                    10 Field List       features
                    10 Field List       fee_stacks
                    10 Field List       fees
                    10 Field List       google_calendar_errors
                    10 Field List       google_calendars
                    10 Field List       guids
                    10 Field List       invoice_item_stacks
                    10 Field List       invoice_items
                    10 Field List       jobs
                    10 Field List       menu_options
                    10 Field List       menu_options_enabled
                    10 Field List       migrations
                    10 Field List       package_fees
                    10 Field List       package_vehicles
                    10 Field List       packages
                    10 Field List       password_new_user
                    10 Field List       password_reminders
                    10 Field List       password_resets
                    10 Field List       payments
                    10 Field List       permission_groups
                    10 Field List       permissions
                    10 Field List       role_permissions
                    10 Field List       roles
                    10 Field List       stripe_keys
                    10 Field List       subscription_plans
                    10 Field List       timezones
                    10 Field List       user_activity_log
                    10 Field List       user_blocked_dates
                    10 Field List       user_roles
                    10 Field List       users
                    10 Field List       vehicle_blocked_dates
                    10 Field List       vehicle_distance_rates
                    10 Field List       vehicle_features
                    10 Field List       vehicles
                    10 Query    select @@version_comment limit 1
200203  0:56:23     10 Quit

하지만 PphStorm과 연결을 시도할 때는 한눈팔지 않습니다.

언급URL : https://stackoverflow.com/questions/60030564/cant-connect-to-mariadb-via-phpstorm-but-terminal-works-fine

반응형