How to install mysql5.6 from centos source code: 1. Download the source code package; 2. Pass "[root@localhost ~]# tar zxvf mysql-5.6.41.tar.gz [root@localhost... "Wait for the command to compile and install mysql.
centos source code installation method for mysql5.6
Mysql version introductionWhen preparing to install MySQL, please decide which version and release format to use ( binary or source). First, decide whether to install a development version or a General Availability (GA) version. Development versions have the latest features but are not recommended for production use. Ga release, also called production or stable release, means for production use. We recommend using the latest GA version.
The naming scheme in MySQL 5.6 uses a release name consisting of three numbers and an optional suffix; for example, mysql-5.6.1-m1. The numbers in the release name are explained as follows:
- The first number (5) is the major version number.
- The second number (6) is the minor version number. Taken together, the major and minor numbers make up the issue series number. Serial numbers describe a stable set of characteristics.
- The third number (1) is the version number in the release series. For every new bug fix release, this value will be increased. In most cases, the latest version in a series is the best choice.
- mN (for example, M1, M2, M3) represents a milestone number. MySQL development uses a milestone model, where each milestone introduces a small set of thoroughly tested features. After a milestone is released, development continues with another small set of releases focusing on the next set of features. From one milestone to the next, functional interfaces may change, or even be removed, based on feedback provided by community members who experimented with these early versions. Features in milestone releases may be considered pre-production quality features.
- rc indicates a Release Candidate (RC). Release candidates are considered stable and have passed all MySQL's internal testing. New features may still be introduced in the RC version, but the focus shifts to fixing bugs to stabilize features introduced earlier in this series.
- No suffix indicates General Availability (GA) or production releases. GA releases are stable, successfully passed the early release phase, and are considered reliable, free of serious bugs, and suitable for use in production systems.
https://dev.mysql.com/downloads/
## Recommended study: "
1. Close selinux and iptables
[root@localhost ~]# /etc/init.d/iptables stopiptables:将链设置为政策 ACCEPT:filter [确定] iptables:清除防火墙规则: [确定] iptables:正在卸载模块: [确定] [root@localhost ~]# setenforce 0setenforce: SELinux is disabled
2. Uninstall mysql-server and mysql in rpm
[root@localhost ~]# rpm -qa | grep mysqlmysql-libs-5.1.73-8.el6_8.x86_64 如果安装了mysql-server使用rpm -e命令将其卸载
3. Install mysql dependency package
[root@localhost ~]# yum install -y cmake gcc gcc-c++ ncurses-devel bison zlib openssl
4. Create mysql user and related folders
[root@localhost ~]# groupadd msyql[root@localhost ~]# useradd -g mysql -s /sbin/nologin mysql[root@localhost ~]# mkdir -p /public/mysql/data
Compile and install mysql
[root@localhost ~]# tar zxvf mysql-5.6.41.tar.gz [root@localhost mysql-5.6.41]# cd mysql-5.6.41 [root@localhost mysql-5.6.41]# cmake \ -DCMAKE_INSTALL_PREFIX=/public/mysql \ -DINSTALL_DATADIR=/public/mysql/data \ -DDEFAULT_CHARSET=utf8 \ -DDEFAULT_COLLATION=utf8_general_ci \ -DEXTRA_CHARSETS=all \ -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=/tmp/mysql.sock \ -DMYSQL_TCP_PORT=3306 \ -DENABLED_LOCAL_INFILE=1 \ -DSYSCONFDIR=/public/mysql [root@localhost mysql-5.6.41]# make && make install
Instructions
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ #安装路径 -DMYSQL_DATADIR=/usr/local/mysql/data \ #数据文件存放位置 -DSYSCONFDIR=/etc \ #my.cnf路径 -DWITH_MYISAM_STORAGE_ENGINE=1 \ #支持MyIASM引擎 -DWITH_INNOBASE_STORAGE_ENGINE=1 \ #支持InnoDB引擎 -DWITH_MEMORY_STORAGE_ENGINE=1 \ #支持Memory引擎 -DWITH_READLINE=1 \ #快捷键功能(我没用过) -DMYSQL_UNIX_ADDR=/tmp/mysqld.sock \ #连接数据库socket路径 -DMYSQL_TCP_PORT=3306 \ #端口 -DENABLED_LOCAL_INFILE=1 \ #允许从本地导入数据 -DWITH_PARTITION_STORAGE_ENGINE=1 \ #安装支持数据库分区 -DEXTRA_CHARSETS=all \ #安装所有的字符集 -DDEFAULT_CHARSET=utf8 \ #默认字符 -DDEFAULT_COLLATION=utf8_general_ci
Post-installation optimization operations
[root@localhost mysql-5.6.41]# chown -R mysql:mysql /public/mysql \ #修改msyql安装目录的属主与属组 [root@localhost mysql-5.6.41]# cp support-files/mysql.server /etc/init.d/mysqld [root@localhost ~]# echo "PATH=$PATH:/public/mysql/bin" > /etc/profile.d/mysql.sh [root@localhost ~]# source /etc/profile.d/mysql.sh [root@localhost ~]# chkconfig mysqld on \ #开机自启 [root@localhost ~]# vim /public/mysql/my.cnf [mysqld] basedir = /public/mysql datadir = /public/mysql/data port = 3306 server_id = 11 socket = /tmp/mysql.sock sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
my.cnf temporarily With this configuration, you can start the database and have time to organize an article on my.cnf
#my.cnf文件优先顺序[root@localhost ~]# mysql --help | grep my.cnf order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/my.cnf /etc/mysql/my.cnf /public/mysql/my.cnf ~/.my.cnf
Initialize the database and set the password
[root@localhost ~]# /public/mysql/scripts/mysql_install_db --user=mysql --basedir=/public/mysql --datadir=/public/mysql/data \ #初始化数据库 [root@localhost ~]# mysqladmin -u root password 'Aa123456' \ #设置root密码(需先启动mysql)
Mysql operation
#启动、停止、重启、状态 [root@localhost ~]# /etc/init.d/mysqld start [root@localhost ~]# /etc/init.d/mysqld stop [root@localhost ~]# /etc/init.d/mysqld restart [root@localhost ~]# /etc/init.d/mysqld status [root@localhost ~]# netstat -utpln | grep mysqld #登录mysql [root@localhost ~]# mysql -u root -pAa123456 \ #-p后面的密码不要有空格
utpln | grep mysqld#Log in to mysql[root@localhost ~]# mysql -u root -pAa123456 \ #-The password after #-p should not have spaces
The above is the detailed content of How to install mysql5.6 from centos source code. For more information, please follow other related articles on the PHP Chinese website!

ACID attributes include atomicity, consistency, isolation and durability, and are the cornerstone of database design. 1. Atomicity ensures that the transaction is either completely successful or completely failed. 2. Consistency ensures that the database remains consistent before and after a transaction. 3. Isolation ensures that transactions do not interfere with each other. 4. Persistence ensures that data is permanently saved after transaction submission.

MySQL is not only a database management system (DBMS) but also closely related to programming languages. 1) As a DBMS, MySQL is used to store, organize and retrieve data, and optimizing indexes can improve query performance. 2) Combining SQL with programming languages, embedded in Python, using ORM tools such as SQLAlchemy can simplify operations. 3) Performance optimization includes indexing, querying, caching, library and table division and transaction management.

MySQL uses SQL commands to manage data. 1. Basic commands include SELECT, INSERT, UPDATE and DELETE. 2. Advanced usage involves JOIN, subquery and aggregate functions. 3. Common errors include syntax, logic and performance issues. 4. Optimization tips include using indexes, avoiding SELECT* and using LIMIT.

MySQL is an efficient relational database management system suitable for storing and managing data. Its advantages include high-performance queries, flexible transaction processing and rich data types. In practical applications, MySQL is often used in e-commerce platforms, social networks and content management systems, but attention should be paid to performance optimization, data security and scalability.

The relationship between SQL and MySQL is the relationship between standard languages and specific implementations. 1.SQL is a standard language used to manage and operate relational databases, allowing data addition, deletion, modification and query. 2.MySQL is a specific database management system that uses SQL as its operating language and provides efficient data storage and management.

InnoDB uses redologs and undologs to ensure data consistency and reliability. 1.redologs record data page modification to ensure crash recovery and transaction persistence. 2.undologs records the original data value and supports transaction rollback and MVCC.

Key metrics for EXPLAIN commands include type, key, rows, and Extra. 1) The type reflects the access type of the query. The higher the value, the higher the efficiency, such as const is better than ALL. 2) The key displays the index used, and NULL indicates no index. 3) rows estimates the number of scanned rows, affecting query performance. 4) Extra provides additional information, such as Usingfilesort prompts that it needs to be optimized.

Usingtemporary indicates that the need to create temporary tables in MySQL queries, which are commonly found in ORDERBY using DISTINCT, GROUPBY, or non-indexed columns. You can avoid the occurrence of indexes and rewrite queries and improve query performance. Specifically, when Usingtemporary appears in EXPLAIN output, it means that MySQL needs to create temporary tables to handle queries. This usually occurs when: 1) deduplication or grouping when using DISTINCT or GROUPBY; 2) sort when ORDERBY contains non-index columns; 3) use complex subquery or join operations. Optimization methods include: 1) ORDERBY and GROUPB


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

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

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

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.