데이터 베이스 MySQL 튜토리얼 Mac mysql이 깨졌을 경우 어떻게 해야 하나요?

Mac mysql이 깨졌을 경우 어떻게 해야 하나요?

Dec 21, 2021 pm 03:10 PM
mac mysql

mac mysql 잘못된 코드에 대한 해결 방법: 1. my.cnf 파일을 찾아서 엽니다. 2. 코드를 "character-set-server=utf8 init_connect='SET NAMES utf8..."으로 추가합니다.

Mac mysql이 깨졌을 경우 어떻게 해야 하나요?

이 기사의 운영 환경: macOS10.15 시스템, Mysql 버전 5.7.26, macbook pro 2020 컴퓨터.

mac mysql이 깨졌을 경우 어떻게 해야 하나요?

mac에서 MySQL의 문자 깨짐 문제를 해결하는 방법

이 문서에서는 Mac에서의 처리 방법에 대해 설명합니다. 내 컴퓨터의 mysql 버전은 5.7.26-log입니다.

인터넷의 많은 게시물에는 /usr/local/mysql/support-files 디렉터리로 이동하여 my-default.cnf를 /etc/my.cnf에 복사하라고 나와 있습니다. 그러면 Linux에서의 수정 방법과 같습니다. Mac 버전의 MySQL은 5.7.18 이후 my-default.cnf가 취소되었기 때문에 my-default.cnf와 my.cnf를 사용할 수 없습니다. my-default.cnf는 이전 버전에만 있던 파일입니다.

안타깝게도 mysql 버전이 5.7.18 이후라면 새 버전을 만드세요

cd /etc
sudo vim my.cnf
로그인 후 복사

다음 코드를 my.cnf

# Example MySQL config file for medium systems.
    #
    # This is for a system with little memory (32M - 64M) where MySQL plays
    # an important part, or systems up to 128M where MySQL is used together with
    # other programs (such as a web server)
    #
    # MySQL programs look for option files in a set of
    # locations which depend on the deployment platform.
    # You can copy this option file to one of those
    # locations. For information about these locations, see:
    # http://dev.mysql.com/doc/mysql/en/option-files.html    #
    # In this file, you can use all long options that a program supports.
    # If you want to know which options a program supports, run the program
    # with the "--help" option.
    # The following options will be passed to all MySQL clients
    [client]    default-character-set=utf8
    #password   = your_password
    port        = 3306
    socket      = /tmp/mysql.sock
    # Here follows entries for some specific programs
    # The MySQL server
    [mysqld]
    character-set-server=utf8
    init_connect='SET NAMES utf8
    port        = 3306
    socket      = /tmp/mysql.sock
    skip-external-locking
    key_buffer_size = 16M
    max_allowed_packet = 1M
    table_open_cache = 64
    sort_buffer_size = 512K
    net_buffer_length = 8K
    read_buffer_size = 256K
    read_rnd_buffer_size = 512K
    myisam_sort_buffer_size = 8M
    character-set-server=utf8
    init_connect='SET NAMES utf8'
    # Don't listen on a TCP/IP port at all. This can be a security enhancement,
    # if all processes that need to connect to mysqld run on the same host.
    # All interaction with mysqld must be made via Unix sockets or named pipes.
    # Note that using this option without enabling named pipes on Windows
    # (via the "enable-named-pipe" option) will render mysqld useless!
    #
    #skip-networking
 
    # Replication Master Server (default)
    # binary logging is required for replication
    log-bin=mysql-bin
 
    # binary logging format - mixed recommended
    binlog_format=mixed
 
    # required unique id between 1 and 2^32 - 1
    # defaults to 1 if master-host is not set
    # but will not function as a master if omitted
    server-id   = 1
 
    # Replication Slave (comment out master section to use this)
    #
    # To configure this host as a replication slave, you can choose between
    # two methods :
    #
    # 1) Use the CHANGE MASTER TO command (fully described in our manual) -
    #    the syntax is:
    #
    #    CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
#    MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
    #
    #    where you replace <host>, <user>, <password> by quoted strings and
        #    <port> by the master's port number (3306 by default).            #
            #    Example:
            #
            #    CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
            #    MASTER_USER='joe', MASTER_PASSWORD='secret';
            #
            # OR
            #
            # 2) Set the variables below. However, in case you choose this method, then
            #    start replication for the first time (even unsuccessfully, for example
            #    if you mistyped the password in master-password and the slave fails to
            #    connect), the slave will create a master.info file, and any later
            #    change in this file to the variables' values below will be ignored and            #    overridden by the content of the master.info file, unless you shutdown
            #    the slave server, delete master.info and restart the slaver server.
            #    For that reason, you may want to leave the lines below untouched
            #    (commented) and instead use CHANGE MASTER TO (see above)
            #
            # required unique id between 2 and 2^32 - 1
            # (and different from the master)
            # defaults to 2 if master-host is set
            # but will not function as a slave if omitted
            #server-id       = 2
            #
            # The replication master for this slave - required
            #master-host     =   <hostname>
                #
                # The username the slave will use for authentication when connecting
                # to the master - required
                #master-user     =   <username>
                #
                # The password the slave will authenticate with when connecting to
                # the master - required
                #master-password =   <password>
                #
                # The port the master is listening on.
                # optional - defaults to 3306
                #master-port     =  <port>
                #
                # binary logging - not required for slaves, but recommended
                #log-bin=mysql-bin
 
                # Uncomment the following if you are using InnoDB tables
                #innodb_data_home_dir = /usr/local/mysql/data
                #innodb_data_file_path = ibdata1:10M:autoextend
                #innodb_log_group_home_dir = /usr/local/mysql/data
                # You can set .._buffer_pool_size up to 50 - 80 %
                # of RAM but beware of setting memory usage too high
                #innodb_buffer_pool_size = 16M
                #innodb_additional_mem_pool_size = 2M
                # Set .._log_file_size to 25 % of buffer pool size
                #innodb_log_file_size = 5M
                #innodb_log_buffer_size = 8M
                #innodb_flush_log_at_trx_commit = 1
                #innodb_lock_wait_timeout = 50
 
                [mysqldump]
                quick
                max_allowed_packet = 16M
 
                [mysql]
                no-auto-rehash
                # Remove the next comment character if you are not familiar with SQL
                #safe-updates                default-character-set=utf8
 
                [myisamchk]
                key_buffer_size = 20M
                sort_buffer_size = 20M
                read_buffer = 2M
                write_buffer = 2M
 
                [mysqlhotcopy]
                interactive-timeout
로그인 후 복사
에 복사하세요

마지막 단계는 mysql 서비스를 다시 시작하는 것입니다

추천 학습: "mysql 비디오 튜토리얼"

위 내용은 Mac mysql이 깨졌을 경우 어떻게 해야 하나요?의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.

핫 AI 도구

Undresser.AI Undress

Undresser.AI Undress

사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

AI Hentai Generator

AI Hentai Generator

AI Hentai를 무료로 생성하십시오.

인기 기사

R.E.P.O. 에너지 결정과 그들이하는 일 (노란색 크리스탈)
3 몇 주 전 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. 최고의 그래픽 설정
3 몇 주 전 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. 아무도들을 수없는 경우 오디오를 수정하는 방법
3 몇 주 전 By 尊渡假赌尊渡假赌尊渡假赌

뜨거운 도구

메모장++7.3.1

메모장++7.3.1

사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전

SublimeText3 중국어 버전

중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기

스튜디오 13.0.1 보내기

강력한 PHP 통합 개발 환경

드림위버 CS6

드림위버 CS6

시각적 웹 개발 도구

SublimeText3 Mac 버전

SublimeText3 Mac 버전

신 수준의 코드 편집 소프트웨어(SublimeText3)

PHP가 MySQL에 연결된 후 페이지가 비어 있습니다. 유효하지 않은 다이 () 함수의 이유는 무엇입니까? PHP가 MySQL에 연결된 후 페이지가 비어 있습니다. 유효하지 않은 다이 () 함수의 이유는 무엇입니까? Apr 01, 2025 pm 03:03 PM

PHP가 MySQL에 연결 한 후 페이지가 비어 있고 Die () 함수가 실패한 이유가 있습니다. PHP와 MySQL 데이터베이스 간의 연결을 배울 때는 종종 혼란스러운 것들이 발생합니다 ...

램프 아키텍처에서 Node.js 또는 Python 서비스를 효율적으로 통합하는 방법은 무엇입니까? 램프 아키텍처에서 Node.js 또는 Python 서비스를 효율적으로 통합하는 방법은 무엇입니까? Apr 01, 2025 pm 02:48 PM

많은 웹 사이트 개발자는 램프 아키텍처에서 Node.js 또는 Python 서비스를 통합하는 문제에 직면 해 있습니다. 기존 램프 (Linux Apache MySQL PHP) 아키텍처 웹 사이트 요구 사항 ...

PC 및 모바일 측면에서 동일한 페이지를 공유하고 캐시 문제를 처리하는 방법은 무엇입니까? PC 및 모바일 측면에서 동일한 페이지를 공유하고 캐시 문제를 처리하는 방법은 무엇입니까? Apr 01, 2025 pm 01:57 PM

PC 및 모바일 측면에서 동일한 페이지를 공유하고 캐시 문제를 처리하는 방법은 무엇입니까? Baota 배경, PC 측면을 만드는 방법 및 ...

데비안 문자열은 여러 브라우저와 호환됩니다 데비안 문자열은 여러 브라우저와 호환됩니다 Apr 02, 2025 am 08:30 AM

"Debiantrings"는 표준 용어가 아니며 구체적인 의미는 여전히 불분명합니다. 이 기사는 브라우저 호환성에 직접 언급 할 수 없습니다. 그러나 "Debiantrings"가 Debian 시스템에서 실행되는 웹 응용 프로그램을 지칭하는 경우 브라우저 호환성은 응용 프로그램 자체의 기술 아키텍처에 따라 다릅니다. 대부분의 최신 웹 응용 프로그램은 크로스 브라우저 호환성에 전념합니다. 이는 웹 표준에 따라 웹 표준과 잘 호환 가능한 프론트 엔드 기술 (예 : HTML, CSS, JavaScript) 및 백엔드 기술 (PHP, Python, Node.js 등)을 사용하는 데 의존합니다. 응용 프로그램이 여러 브라우저와 호환되도록 개발자는 종종 브라우저 크로스 테스트를 수행하고 응답 성을 사용해야합니다.

Docker는 LNMP 환경을 구축합니다. 단일 Dockerfile 또는 Docker가 더 나은가? Docker는 LNMP 환경을 구축합니다. 단일 Dockerfile 또는 Docker가 더 나은가? Apr 01, 2025 pm 02:09 PM

Dockerfile LNMP 환경 학습을위한 Dockerfile 모범 사례 Docker 동안 많은 개발자가 자체 LNMP (Linux, Nginx, MySQL, PHP)를 구축하려고합니다.

Redis 대기열과 MySQL 안정성 비교 : Redis가 데이터 손실에 발생하는 이유는 무엇입니까? Redis 대기열과 MySQL 안정성 비교 : Redis가 데이터 손실에 발생하는 이유는 무엇입니까? Apr 01, 2025 pm 02:24 PM

Redis 대기열과 MySQL 안정성 비교 : Redis가 데이터 손실에 발생하는 이유는 무엇입니까? PHP7.2 및 ThinkPHP 프레임 워크를 사용하여 개발 환경에서 우리는 종종 협력의 선택에 직면 해 있습니다 ...

Django와 MySQL을 사용하여 수십만에서 2 백만에서 2 백만 건의 데이터를 처리 할 때, 4 코어 8G 메모리 서버는 어떤 종류의 캐시 솔루션을 선택해야합니까? Django와 MySQL을 사용하여 수십만에서 2 백만에서 2 백만 건의 데이터를 처리 할 때, 4 코어 8G 메모리 서버는 어떤 종류의 캐시 솔루션을 선택해야합니까? Apr 01, 2025 pm 11:36 PM

Django 및 MySQL을 사용하여 Django 및 MySQL 데이터베이스를 사용할 때 큰 데이터 볼륨을 처리합니다. 데이터 볼륨이 수십만에서 2 백만에 도달하면 ...

See all articles