shell> sudo yum install -y cmake,make,gcc,gcc-c++,bison, ncurses,ncurses-devel
shell> wget -O https://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz shell> tar -zxvf boost_1_59_0.tar.gz -C /usr/local/
shell> cd /opt shell> git clone https://github.com/mysql/mysql-server.git shell> ls mysql-server
shell> git branch -r origin/5.5 origin/5.6 origin/5.7 origin/HEAD -> origin/5.7 origin/cluster-7.2 origin/cluster-7.3 origin/cluster-7.4 origin/cluster-7.5
shell> cd /opt/mysql-server shell> groupadd mysql #添加mysql用户组 shell> useradd -r -g mysql -s /bin/false mysql #添加mysql用户
shell> cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ -DMYSQL_DATADIR=/usr/local/mysql/data \ -DWITH_BOOST=/usr/local/boost_1_59_0 \ -DSYSCONFDIR=/etc \ -DEFAULT_CHARSET=utf8mb4 \ -DDEFAULT_COLLATION=utf8mb4_general_ci \ -DENABLED_LOCAL_INFILE=1 \ -DEXTRA_CHARSETS=all
shell> make -j `grep processor /proc/cpuinfo | wc -l` shell> make install
shell> cd /usr/local/mysql shell> chown -R mysql:mysql . # 注意:MySQL 5.7.6之前的版本执行这个脚本初始化系统数据库 shell> ./bin/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data # 5.7.6之后版本初始系统数据库脚本(本文使用此方式初始化) shell> ./bin/mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data shell> ./bin/mysql_ssl_rsa_setup shell> chown -R root . shell> chown -R mysql data
shell> cp support-files/my-default.cnf /etc/my.cnf shell> vim /etc/my.cnf [client] port=3306 socket=/usr/local/mysql/mysql.sock [mysqld] character-set-server=utf8 collation-server=utf8_general_ci skip-external-locking skip-name-resolve user=mysql port=3306 basedir=/usr/local/mysql datadir=/usr/local/mysql/data tmpdir=/usr/local/mysql/temp # server_id = ..... socket=/usr/local/mysql/mysql.sock log-error=/usr/local/mysql/logs/mysql_error.log pid-file=/usr/local/mysql/mysql.pid open_files_limit=10240 back_log=600 max_connections=500 max_connect_errors=6000 wait_timeout=605800 #open_tables=600 #table_cache = 650 #opened_tables = 630 max_allowed_packet=32M sort_buffer_size=4M join_buffer_size=4M thread_cache_size=300 query_cache_type=1 query_cache_size=256M query_cache_limit=2M query_cache_min_res_unit=16k tmp_table_size=256M max_heap_table_size=256M key_buffer_size=256M read_buffer_size=1M read_rnd_buffer_size=16M bulk_insert_buffer_size=64M lower_case_table_names=1 default-storage-engine=INNODB innodb_buffer_pool_size=2G innodb_log_buffer_size=32M innodb_log_file_size=128M innodb_flush_method=O_DIRECT ##################### thread_concurrency=32 long_query_time=2 slow-query-log=on slow-query-log-file=/usr/local/mysql/logs/mysql-slow.log [mysqldump] quick max_allowed_packet=32M [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid
shell> cp support-files/mysql.server /etc/init.d/mysqld shell> chkconfig --add mysqld # 添加到系统服务 shell> chkconfig mysqld on # 开机启动
shell> service mysqld start # 启动mysql服务 shell> service mysqld stop # 停止mysql服务 shell> service mysqld restart # 重新启动mysql服务
shell> /usr/local/mysql/bin/mysql -e "grant all privileges on *.* to root@'127.0.0.1' identified by "root" with grant option;" shell> /usr/local/mysql/bin/mysql -e "grant all privileges on *.* to root@'localhost' identified by "root" with grant option;" # 开启远程登录(将host设为%即可) /usr/local/mysql/bin/mysql -e "grant all privileges on *.* to root@'%' identified by "root" with grant option;"
shell> vim /etc/profile shell> export PATH=/usr/local/mysql/bin:$PATH shell> source /etc/profile
shell> cd /opt/mysql-server shell> rm -f CMakeCache.txt shell> make clean
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有