1. Installieren Sie zuerst das Abhängigkeitspaket
yum install -y gcc gcc-c++ ncurses-devel perl openssl-devel
Das Wichtigste ist, nicht zu vergessen, openssl-devel zu installieren
(empfohlen kostenlos). Lernvideo-Tutorial:MySQL-Video-Tutorial
2. Installieren Sie cmaketar -xzvf cmake-3.8.1.tar.gz cd cmake-3.8.1 ./bootstrap make && make install
groupadd mysql useradd -r -g mysql mysql
mkdir -p /var/mysql/data chown mysql:mysql /var/mysql/data
cd mysql-boost-5.7.18 cmake . \ -DCMAKE_INSTALL_PREFIX=/usr/local/mysql/ \ -DINSTALL_DATADIR=/usr/local/mysql/data/master \ -DSYSCONFDIR=/usr/local/mysql/etc \ -DDEFAULT_CHARSET=utf8 \ -DDEFAULT_COLLATION=utf8_general_ci \ -DEXTRA_CHARSETS=all \ -DWITH_SSL=system \ -DWITH_EMBEDDED_SERVER=1 \ -DENABLED_LOCAL_INFILE=1 \ -DWITH_MYISAM_STORAGE_ENGINE=1 \ -DWITH_INNOBASE_STORAGE_ENGINE=1 \ -DWITH_ARCHIVE_STORAGE_ENGINE=1 \ -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \ -DWITH_MEMORY_STORAGE_ENGINE=1 \ -DWITH_FEDERATED_STORAGE_ENGINE=1 \ -DWITH_PARTITION_STORAGE_ENGINE=1 \ -DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \ -DMYSQL_USER=mysql \ -DMYSQL_UNIX_ADDR=/usr/local/mysql/data/mysql.sock \ -DDOWNLOAD_BOOST=1 \ -DWITH_BOOST=/usr/local/boost
make && make install
chown -R mysql:mysql /usr/local/mysql
cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf
#For advice on how to change settings please see # http://dev.mysql.com/doc/refman/5.7/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. [mysqld] #aracter_set_server=utf8 #init_connect='SET NAMES utf8' sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES # 一般配置选项 basedir = /usr/local/mysql datadir = /usr/local/mysql/data/master port = 3306 socket = /usr/local/mysql/data/mysql.sock character-set-server=utf8 back_log = 300 max_connections = 3000 max_connect_errors = 50 table_open_cache = 4096 max_allowed_packet = 32M #binlog_cache_size = 4M max_heap_table_size = 128M read_rnd_buffer_size = 16M sort_buffer_size = 16M join_buffer_size = 16M thread_cache_size = 16 query_cache_size = 128M query_cache_limit = 4M ft_min_word_len = 8 thread_stack = 512K transaction_isolation = REPEATABLE-READ tmp_table_size = 128M #log-bin=mysql-bin long_query_time = 6 server_id=1 innodb_buffer_pool_size = 1G innodb_thread_concurrency = 16 innodb_log_buffer_size = 16M innodb_log_file_size = 512M innodb_log_files_in_group = 3 innodb_max_dirty_pages_pct = 90 innodb_lock_wait_timeout = 120 innodb_file_per_table = on [mysqldump] quick max_allowed_packet = 32M [mysql] no-auto-rehash default-character-set=utf8 safe-updates [myisamchk] key_buffer = 16M sort_buffer_size = 16M read_buffer = 8M write_buffer = 8M [mysqlhotcopy] interactive-timeout [mysqld_safe] open-files-limit = 8192 [client] port=3306 socket=/usr/local/mysql/data/mysql.sock #default-character-set=utf8
/usr/local/mysql/bin/mysqld --initialize --user=mysql,
set password=password('你的密码');
oder das Verzeichnis /etc/ einzugeben und vim rc.local direkt zu bearbeiten, um rc.local zu bearbeiten Datei hinzufügen und in der letzten Zeile „service mysqld start“ hinzufügen, speichern und beenden. echo "service mysqld start" >> /etc/rc.local
Das obige ist der detaillierte Inhalt vonDetaillierte Erklärung zur Installation von MySQL5.7.18 unter dem Centos-System. Für weitere Informationen folgen Sie bitte anderen verwandten Artikeln auf der PHP chinesischen Website!