大环境下MySQL5.6源码安装实战一步步教你CentOS6.5_64bit下编译安装MySQL-5.6.23@guoy_MySQL
一、关闭防火墙
chkconfig iptables off service iptables stop
三、删除MyQL(redhat6.3服务器自带的mysql-libs是mysql-libs-5.1.61-4.el6.x86_64,可能会和高版本的mysql-libs有冲突)
groupadd mysql #增加用户组 useradd -d /home/mysql -g mysql mysql
八、创建目录及授权
mkdir -p /u01/my3306/data mkdir -p /u01/my3306/log/iblog mkdir -p /u01/my3306/log/binlog mkdir -p /u01/my3306/log/relaylog mkdir -p /u01/my3306/run mkdir -p /u01/my3306/tmp chown -R mysql:mysql /u01/my3306 chmod -R 777 /u01/my3306
十、编译并安装
cmake \ -DCMAKE_INSTALL_PREFIX=/u01/my3306 \ -DINSTALL_DATADIR=/u01/my3306/data \ -DDEFAULT_CHARSET=utf8 \ -DDEFAULT_COLLATION=utf8_general_ci \ -DEXTRA_CHARSETS=all \ -DWITH_SSL=yes \ -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_FEDERATED_STORAGE_ENGINE=1 \ -DWITH_PARTITION_STORAGE_ENGINE=1 \ -DMYSQL_UNIX_ADDR=/u01/my3306/run/mysql.sock \ -DMYSQL_TCP_PORT=3306 \ -DENABLED_LOCAL_INFILE=1 \ -DSYSCONFDIR=/etc \ -DWITH_READLINE=on make make install
[client] port=3306 socket=/u01/my3306/mysql.sock [mysql] pid_file=/u01/my3306/run/mysqld.pid [mysqld] # disable autocommit autocommit=0 general_log=off explicit_defaults_for_timestamp=true sha256_password_private_key_path=/u01/my3306/mykey.pem sha256_password_public_key_path=/u01/my3306/mykey.pub # system basedir=/u01/my3306 datadir=/u01/my3306/data max_allowed_packet=134217728 max_connections=8192 max_user_connections=8000 open_files_limit=65535 pid_file=/u01/my3306/run/mysqld.pid port=3306 server_id=101 skip_name_resolve=ON socket=/u01/my3306/run/mysql.sock tmpdir=/u01/my3306/tmp #binlog #log-bin=/u01/my3306/log/binlog log_bin=/u01/my3306/log/binlog/binlog binlog_cache_size=32768 binlog_format=row expire_logs_days=7 log_slave_updates=ON max_binlog_cache_size=2147483648 max_binlog_size=524288000 sync_binlog=100 #logging log_error=/u01/my3306/log/alert.log slow_query_log_file=/u01/my3306/log/slow.log log_queries_not_using_indexes=1 slow_query_log=1 log_slave_updates=ON log_slow_admin_statements=1 long_query_time=1 #relay relay_log=/u01/my3306/log/relaylog relay_log_index=/u01/my3306/log/relay.index relay_log_info_file=/u01/my3306/log/relay-log.info #slave slave_load_tmpdir=/u01/my3306/tmp slave_skip_errors=OFF #innodb innodb_data_home_dir=/u01/my3306/log/iblog innodb_log_group_home_dir=/u01/my3306/log/iblog innodb_adaptive_flushing=ON innodb_adaptive_hash_index=ON innodb_autoinc_lock_mode=1 innodb_buffer_pool_instances=8 #default innodb_change_buffering=inserts innodb_checksums=ON innodb_buffer_pool_size= 128M innodb_data_file_path=ibdata1:32M;ibdata2:16M:autoextend innodb_doublewrite=ON innodb_file_format=Barracuda innodb_file_per_table=ON innodb_flush_log_at_trx_commit=1 innodb_flush_method=O_DIRECT innodb_io_capacity=1000 innodb_lock_wait_timeout=10 innodb_log_buffer_size=67108864 innodb_log_file_size=1048576000 innodb_log_files_in_group=4 innodb_max_dirty_pages_pct=60 innodb_open_files=60000 innodb_purge_threads=1 innodb_read_io_threads=4 innodb_stats_on_metadata=OFF innodb_support_xa=ON innodb_use_native_aio=OFF innodb_write_io_threads=10 [mysqld_safe] datadir=/u01/my3306/data
rm -rf /u01/my3306/data/* rm -rf /u01/my3306/log/iblog/* rm -rf /u01/my3306/log/binlog/* chmod -R 777 /u01/my3306/data/ chmod -R 777 /u01/my3306/log/iblog/ chmod -R 777 /u01/my3306/log/binlog/ chmod 755 /u01/my3306/my.cnf ./scripts/mysql_install_db --defaults-file=/u01/my3306/my.cnf --datadir=/u01/my3306/data --user=mysql chmod -R 777 /u01/my3306/data/ chmod -R 777 /u01/my3306/log/iblog/ chmod -R 777 /u01/my3306/log/binlog/
十三、启动mysql
vi .bash_profile ---root用户下添加 PATH=$PATH:$HOME/bin:/u01/my3306/bin mysqld_safe --defaults-file=/u01/my3306/my.cnf --user=mysql &
[root@uubee8 ~]# mysql -h127.0.0.1 -uroot Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.6.23-log Source distribution Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show variables like '%log-bin%'; Empty set (0.00 sec) mysql> show variables like '%bin%'; +-----------------------------------------+------------------------------+ | Variable_name | Value | +-----------------------------------------+------------------------------+ | bind_address | * | | binlog_cache_size | 32768 | | binlog_checksum | CRC32 | | binlog_direct_non_transactional_updates | OFF | | binlog_error_action | IGNORE_ERROR | | binlog_format | ROW | | binlog_gtid_simple_recovery | OFF | | binlog_max_flush_queue_time | 0 | | binlog_order_commits | ON | | binlog_row_image | FULL | | binlog_rows_query_log_events | OFF | | binlog_stmt_cache_size | 32768 | | binlogging_impossible_mode | IGNORE_ERROR | | innodb_api_enable_binlog | OFF | | innodb_locks_unsafe_for_binlog | OFF | | log_bin | ON | | log_bin_basename | /u01/my3306/log/binlog | | log_bin_index | /u01/my3306/log/binlog.index | | log_bin_trust_function_creators | OFF | | log_bin_use_v1_row_events | OFF | | max_binlog_cache_size | 2147483648 | | max_binlog_size | 524288000 | | max_binlog_stmt_cache_size | 18446744073709547520 | | simplified_binlog_gtid_recovery | OFF | | sql_log_bin | ON | | sync_binlog | 100 | +-----------------------------------------+------------------------------+ 26 rows in set (0.00 sec)
##################################################################################################################################
1.初始化MySQL脚本: sh init3306.sh rm -rf /u01/my3306/data/* rm -rf /u01/my3306/log/iblog/* rm -rf /u01/my3306/log/binlog/* chmod -R 777 /u01/my3306/data/ chmod -R 777 /u01/my3306/log/iblog/ chmod -R 777 /u01/my3306/log/binlog/ chmod 755 /u01/my3306/my.cnf ./scripts/mysql_install_db --defaults-file=/u01/my3306/my.cnf --datadir=/u01/my3306/data --user=mysql chmod -R 777 /u01/my3306/data/ chmod -R 777 /u01/my3306/log/iblog/ chmod -R 777 /u01/my3306/log/binlog/ 2.启动MySQL脚本 sh start3306.sh mysqld_safe --defaults-file=/u01/my3306/my.cnf --user=mysql & 3.登录MySQL脚本 sh logon3306.sh mysql -h127.0.0.1 -uroot

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

As a high-level programming language, Python language is easy to learn, easy to read and write, and has been widely used in the field of software development. However, due to the open source nature of Python, the source code is easily accessible to others, which brings some challenges to software source code protection. Therefore, in practical applications, we often need to take some methods to protect Python source code and ensure its security. In software source code protection, there are a variety of application practices for Python to choose from. Below are some common

PHP Practice: Code Example to Quickly Implement the Fibonacci Sequence The Fibonacci Sequence is a very interesting and common sequence in mathematics. It is defined as follows: the first and second numbers are 0 and 1, and from the third Starting with numbers, each number is the sum of the previous two numbers. The first few numbers in the Fibonacci sequence are 0,1,1.2,3,5,8,13,21,...and so on. In PHP, we can generate the Fibonacci sequence through recursion and iteration. Below we will show these two

This article brings you relevant knowledge about uniapp cross-domain, and introduces issues related to subcontracting of uniapp and mini programs. Each mini program that uses subcontracting must contain a main package. The so-called main package is where the default startup page/TabBar page is placed, and some public resources/JS scripts are required for all sub-packages; while sub-packages are divided according to the developer's configuration. I hope it will be helpful to everyone.

Steps to view tomcat source code in IDEA: 1. Download Tomcat source code; 2. Import Tomcat source code in IDEA; 3. View Tomcat source code; 4. Understand the working principle of Tomcat; 5. Precautions; 6. Continuous learning and updating ; 7. Use tools and plug-ins; 8. Participate in the community and contribute. Detailed introduction: 1. Download the Tomcat source code. You can download the source code package from the official website of Apache Tomcat. Usually these source code packages are in ZIP or TAR format, etc.

You can use the browser's developer tools to view the source code of the website. In the Google Chrome browser: 1. Open the Chrome browser and visit the website where you want to view the source code; 2. Right-click anywhere on the web page and select "Inspect" or press the shortcut key Ctrl + Shift + I to open the developer tools; 3. In the top menu bar of the developer tools, select the "Elements" tab; 4. Just see the HTML and CSS code of the website.

How to display the source code of PHP code in the browser without being interpreted and executed? PHP is a server-side scripting language commonly used to develop dynamic web pages. When a PHP file is requested on the server, the server interprets and executes the PHP code in it and sends the final HTML content to the browser for display. However, sometimes we want to display the source code of the PHP file directly in the browser instead of being executed. This article will introduce how to display the source code of PHP code in the browser without being interpreted and executed. In PHP, you can use

MySQL table design practice: Create an e-commerce order table and product review table. In the database of the e-commerce platform, the order table and product review table are two very important tables. This article will introduce how to use MySQL to design and create these two tables, and give code examples. 1. Design and creation of order table The order table is used to store the user's purchase information, including order number, user ID, product ID, purchase quantity, order status and other fields. First, we need to create a table named "order" using CREATET

The data export function is a very common requirement in actual development, especially in scenarios such as back-end management systems or data report export. This article will take the Golang language as an example to share the implementation skills of the data export function and give specific code examples. 1. Environment preparation Before starting, make sure you have installed the Golang environment and are familiar with the basic syntax and operations of Golang. In addition, in order to implement the data export function, you may need to use a third-party library, such as github.com/360EntSec
