>  기사  >  데이터 베이스  >  Mysql 애플리케이션 설치 후 my.ini 파일을 찾을 수 없는 문제를 해결하는 방법

Mysql 애플리케이션 설치 후 my.ini 파일을 찾을 수 없는 문제를 해결하는 방법

WBOY
WBOY앞으로
2023-06-02 22:25:398390검색

    1. 배경

    두 대의 컴퓨터에 MySQL Server 8.0을 설치하고 계속 마스터-슬레이브 구성을 준비했습니다. 이때 구성을 위해 my.ini 파일을 사용해야 하는데 my를 찾을 수 없습니다. .ini 파일입니다.

    내 설치 디렉터리에 my.ini 파일이 없습니다. (여기서 mysql 설치 디렉터리는 C:Program FilesMySQLMySQL Server 8.0입니다.)

    Mysql 애플리케이션 설치 후 my.ini 파일을 찾을 수 없는 문제를 해결하는 방법

    그런 다음 다시 구성해야 합니다.

    2. 원래 mysql 서비스를 삭제합니다

    제 mysql을 한동안 사용했기 때문에 서비스를 삭제하고 여기서 다시 구성하겠습니다.

    삭제 방법.

    mysql이 설치된 bin 디렉토리를 입력하세요. 경로 표시줄에 cmd 명령을 입력하여 명령 프롬프트로 들어갑니다.

    Mysql 애플리케이션 설치 후 my.ini 파일을 찾을 수 없는 문제를 해결하는 방법

    Mysql 애플리케이션 설치 후 my.ini 파일을 찾을 수 없는 문제를 해결하는 방법

    mysql 서비스의 이름을 확인하세요. 우리의 서비스 이름은 MySQLD514입니다. 이 이름은 모든 사람의 상황이 다를 수 있으므로 해당 이름을 직접 입력해야 합니다. )

    Mysql 애플리케이션 설치 후 my.ini 파일을 찾을 수 없는 문제를 해결하는 방법

    Mysql 애플리케이션 설치 후 my.ini 파일을 찾을 수 없는 문제를 해결하는 방법

    명령은 다음과 같습니다.

    # 删除已安装的mysql服务
    sc delete MySQLD514

    3. mysql

    # 初始化mysql
    mysqld --initialize-insecure --user=mysql

    Mysql 애플리케이션 설치 후 my.ini 파일을 찾을 수 없는 문제를 해결하는 방법

    4.bin 폴더의 동일한 레벨 디렉터리에 my.ini 파일을 직접 추가합니다. 새로운 my.ini 파일을 생성합니다.

    Mysql 애플리케이션 설치 후 my.ini 파일을 찾을 수 없는 문제를 해결하는 방법다음 스크립트를 my.ini 파일에 복사합니다.

    # For advice on how to change settings please see
    # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
    # *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
    # *** default location during install, and will be replaced if you
    # *** upgrade to a newer version of MySQL.
    [client]
    default-character-set = utf8mb4
    [mysql]
    default-character-set = utf8mb4
    [mysqld]
    character-set-client-handshake = FALSE
    character-set-server = utf8mb4
    collation-server = utf8mb4_bin
    init_connect='SET NAMES utf8mb4'
    # Remove leading # and set to the amount of RAM for the most important data
    # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
    innodb_buffer_pool_size = 128M
    # Remove leading # to turn on a very important data integrity option: logging
    # changes to the binary log between backups.
    # log_bin
    # These are commonly set, remove the # and set as required.
    basedir = D:\MySQL
    datadir = D:\MySQL\data
    port = 3306
    server_id = 1
    # Remove leading # to set options mainly useful for reporting servers.
    # The server defaults are faster for transactions and fast SELECTs.
    # Adjust sizes as needed, experiment to find the optimal values.
    join_buffer_size = 128M
    sort_buffer_size = 16M
    read_rnd_buffer_size = 16M 
    sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

    5. 새로운 mysql 서비스를 생성합니다

    MySql이라는 서비스를 생성한다는 명령을 입력합니다. 해당 구성 파일은 C:Program FilesMySQLMySQL Server입니다. 8.0my.ini

    # 创建mysql服务
    mysqld --install "MySql" --defaults-file="C:\Program Files\MySQL\MySQL Server 8.0\my.ini"

    Mysql 애플리케이션 설치 후 my.ini 파일을 찾을 수 없는 문제를 해결하는 방법 서비스를 다시 열면 MySql 서비스 항목을 볼 수 있습니다.

    Mysql 애플리케이션 설치 후 my.ini 파일을 찾을 수 없는 문제를 해결하는 방법 6. mysql 서비스 시작

    서비스에서 직접 시작하거나 cmd에서 명령으로 시작할 수 있습니다. 명령은 다음과 같습니다.

    net start MySql

    Mysql 애플리케이션 설치 후 my.ini 파일을 찾을 수 없는 문제를 해결하는 방법 7. 데이터베이스 비밀번호 설정

    7.1 mysql 데이터베이스에 로그인

    bin 디렉터리에서 cmd를 시작합니다. 다음 명령을 입력하십시오.

    mysql -u root -p

    지금은 비밀번호가 비어 있으므로 입력할 필요가 없습니다. Enter만 누르세요.

    Mysql 애플리케이션 설치 후 my.ini 파일을 찾을 수 없는 문제를 해결하는 방법7.2 루트 사용자 비밀번호 수정

    루트 사용자 비밀번호를 123456

    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';

    Mysql 애플리케이션 설치 후 my.ini 파일을 찾을 수 없는 문제를 해결하는 방법으로 설정하세요. 로그아웃했다가 다시 로그인하세요.

    위 내용은 Mysql 애플리케이션 설치 후 my.ini 파일을 찾을 수 없는 문제를 해결하는 방법의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

    성명:
    이 기사는 yisu.com에서 복제됩니다. 침해가 있는 경우 admin@php.cn으로 문의하시기 바랍니다. 삭제