Home Database Mysql Tutorial CentOS 6.3/6.4 Minimal 源码安装 MySQL 5.6.10_MySQL

CentOS 6.3/6.4 Minimal 源码安装 MySQL 5.6.10_MySQL

Jun 01, 2016 pm 01:35 PM
internet Specific steps formal edition network card

CentOS

bitsCN.com

MySQL 5.6正式版发布了,相对于5.5版本作出了不少改进,其源码安装配置方式也有所变化,本文根据实际操作,不断尝试,精确还原了安装的具体步骤。

环境:CentOS 6.3/6.4 最小化缺省安装,配置好网卡。

安装MySQL前,确认Internet连接正常,以便下载安装文件。

先使用 yum -y update 指令升级系统到最新版本。

本安装将MySQL的数据文件与执行文件分离,如果你打算设置到不同的路径,注意修改对应的执行命令和数据库初始化脚本。

# 修改防火墙设置,打开3306端口
vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

# 重启防火墙使新设置生效
service iptables restart

# 新增用户组
groupadd mysql

# 新增用户
useradd mysql -g mysql

# 新建数据库执行文件目录
mkdir -p /usr/local/mysql

# 新建数据库数据文件目录
mkdir -p /db/mysql/data

# 编辑PATH搜索路径
vi /etc/profile
Append these 2 lines to the end of the file:
PATH=/usr/local/mysql/bin:/usr/local/mysql/lib:$PATH
export PATH

# 生效PATH搜索路径
source /etc/profile

# 编辑hosts文件,加入本机IP和主机名
vi /etc/hosts
192.168.211.100      centhost.centdomain

# 安装编译源码所需的工具和库
yum -y install wget gcc-c++ ncurses-devel cmake make perl

# 进入源码压缩包下载目录
cd /usr/local/src

# 下载源码压缩包,下载包34M大小,有点慢,等吧。
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.10.tar.gz/from/http://cdn.mysql.com/

# 解压缩源码包
tar -zxvf mysql-5.6.10.tar.gz

# 进入解压缩源码目录
cd mysql-5.6.10

# 从mysql5.5起,mysql源码安装开始使用cmake了,执行源码编译配置脚本。

cmake /
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql /
-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock /
-DDEFAULT_CHARSET=utf8 /
-DDEFAULT_COLLATION=utf8_general_ci /
-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_READLINE=1 /
-DENABLED_LOCAL_INFILE=1 /
-DMYSQL_DATADIR=/db/mysql/data /
-DMYSQL_USER=mysql /
-DMYSQL_TCP_PORT=3306

# 编译源码,这一步时间会较长,耐心等待。
make

# 安装
make install

# 清除安装临时文件
make clean

# 修改目录拥有者
chown -R mysql:mysql /usr/local/mysql
chown -R mysql:mysql /db/mysql/data

# 进入安装路径
cd /usr/local/mysql

# 执行初始化配置脚本,创建系统自带的数据库和表。
scripts/mysql_install_db --user=mysql --datadir=/db/mysql/data
初始化脚本在 /usr/local/mysql/my.cnf 生成了配置文件。需要更改该配置文件的所有者:
chown -R mysql:mysql /usr/local/mysql
多说两句:在启动MySQL服务时,会按照一定次序搜索my.cnf,先在/etc目录下找,找不到则会搜索"$basedir/my.cnf",在本例中就是 /usr/local/mysql/my.cnf,这是新版MySQL的配置文件的默认位置!

# 复制服务启动脚本
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql

# 启动MySQL服务
service mysql start

# 设置开机自动启动服务
chkconfig mysql on

# 修改MySQL用户root的密码
mysql -u root

mysql>use mysql;
mysql>GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "root";
mysql>update user set Password = password('123456') where User='root';
mysql>flush privileges;
mysql>exit;

# 可选:运行安全设置脚本,修改MySQL用户root(不是系统的root!)的密码,禁止root远程连接(防止破解密码),移除test数据库和匿名用户,强烈建议生产服务器使用:

/usr/local/mysql/bin/mysql_secure_installation

>>>>>>>>>>>>>>>完成

bitsCN.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What kind of network card is Crab card? What kind of network card is Crab card? Oct 09, 2022 pm 02:42 PM

The crab card refers to the Realtek network card. Its icon looks like a crab, so it is called the crab card network card. A network card is a piece of computer hardware designed to allow computers to communicate on a computer network, allowing users to connect to each other via cables or wirelessly. Realtek uses the crab as its corporate logo and hopes that it can imitate the symbolism of the crab's tenacity, fearlessness, and courage to challenge in nature.

What is public IP What is public IP Sep 27, 2021 am 10:30 AM

Public IP refers to a non-reserved address connected to the Internet using the public network, and can be freely accessed by other computers on the Internet. Each computer on the Internet has an independent IP address. This IP address uniquely identifies a computer on the Internet. This IP address refers to the public IP address.

How to check whether the network card is normal in Linux How to check whether the network card is normal in Linux Mar 22, 2023 am 10:08 AM

How to check whether the network card is normal in Linux: 1. Check the network card status through the "mii-tool" command; 2. Check the network status through "network status"; 3. Check the information of all network interfaces in Linux through the "ifconfig -a" command; 4. Query the network card information through the "ethtool" command.

How to solve the problem of unable to access the Internet in win11? Guide to solving the problem of Win11 computer being unable to connect to the internet How to solve the problem of unable to access the Internet in win11? Guide to solving the problem of Win11 computer being unable to connect to the internet Jan 29, 2024 pm 08:57 PM

When we use computers, we are all connected to the Internet. Only with the Internet can we surf the Internet. Recently, many users have asked me how to solve the problem of Win11 unable to connect to the Internet? Users can directly open the best matching service application provided by the system to set it up. Let this site carefully introduce to users the solution to the problem that Win11 computers cannot access the Internet. Solution 1 for Win11 computers unable to access the internet: You can press the Win+S key combination, or click the search icon next to the bottom taskbar to open the Windows search window. Enter "service" in the search box, and then click to open the best matching service application given by the system. Method Two

How to uninstall the network card driver on win11 How to uninstall the network card driver on win11 Dec 28, 2023 pm 07:04 PM

The mismatch of the network card driver will result in the inability to access the Internet normally, but it cannot be updated normally. At this time, you can uninstall the network card driver in win11 and then reinstall it to solve the problem. You only need to operate it in the device manager. Tutorial on uninstalling the network card driver in win11: 1. First, right-click the "Windows Logo" at the bottom. 2. Then click on "Device Manager" in the right-click menu. 3. After opening, expand "Network Adapters" and find the network card device. 4. Then double-click to open the device you want to uninstall the driver, enter "Driver" 5. Finally, select "Uninstall Device" to uninstall the win11 network card driver.

What is the communication protocol of the internet? What is the communication protocol of the internet? Dec 24, 2020 pm 02:53 PM

The main communication protocol used by the Internet is "TCP/IP protocol", TCP/IP transmission protocol, namely transmission control/network protocol, also called network communication protocol; it is the most basic communication protocol in the use of the network, TCP/IP The IP transport protocol stipulates the standards and methods for communication between various parts of the Internet.

How to check the network card in linux How to check the network card in linux Jan 05, 2023 pm 02:16 PM

How to check the network card in Linux: 1. Check the network interface information through the "ifconfig" command; 2. Check the network card device list through the "lspci | grep -i 'eth'" or "lspci | grep -i net" command; 3. Use the "iwconfig" command to check whether there is a wireless network card device on the device; 4. Use the "ethtool" command to query the configuration network card parameters.

How to set up Windows 11 without an Internet connection How to set up Windows 11 without an Internet connection Apr 15, 2023 am 10:46 AM

Starting with build 22557 and later, Windows 11 requires an Internet connection to complete first-time setup, also known as the Out-of-Box Experience (OOBE) for Home and Pro editions, although there is a way to bypass this requirement entirely. Since Microsoft wants users to connect their computers to their Microsoft accounts, the company is making changes to the initial Windows 11 setup that will make it nearly impossible to proceed with a clean installation without an Internet connection. Alternatively, if Settings detects that the device has no network connection, you will be sent to the Oops, you lost your Internet connection screen. If you click on the retry option you will see Connect to the Internet again

See all articles