Mysql 源码安装
时间:2021-07-01 10:21:17
帮助过:3人阅读
* GNU make 3.75 or higher* A working ANSI C++ compiler. GCC 4.2.1 or later* erl is needed if you intend to run test scripts
### How to Get MySQL选择自己的系统进行下载 ,直接下载.tar.gz源码
http://cdn.mysql.com//Downloads/MySQL-5.6/mysql-5.6.31-linux-glibc2.5-x86_64.tar.gz
解压后的文件目录架构如下所示:Directory | Contents of Directory |
---|
bin , scripts | mysqld server, client and utility programs |
data | Log files, databases |
docs | MySQL manual in Info format |
man | Unix manual pages |
include | Include (header) files |
lib | Libraries |
share | Miscellaneous support files, including error messages, sample configuration files, SQL for database installation |
sql-bench | Benchmarks |
### 开始安装建立用户,解压文件shell> groupadd mysqlshell> useradd -g mysql mysqlshell> cd /usr/localshell> tar zxvf /path/to/mysql-VERSION-OS.tar.gzshell> ln -s full-path-to-mysql-VERSION-OS mysqlshell> cd mysqlshell> chown -R mysql .shell> chgrp -R mysql .
自定义数据文件的保存文件shell> mkdir -p /data/mysql
初始化mysql,basedir 是解压安装文件的目录shell>/script/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/data/mysql/
修改配置文件 ,并建立配置文件短链接vi /usr/
local
/mysql/my.cnf
basedir = /usr/
local
/mysql
datadir = /data/mysql
ln -s /usr/
local
/mysql/my.cnf /etc/my.cnf
shell> cp support-files/mysql.server /etc/init.d/mysqld 将常用启动服务放到/etc/init文件中
增加环境变量vi /etc/profile
export PATH=$PATH:/usr/
local
/mysql/bin
source /etc/profile 立即生效配置
service mysqld start 启动mysql程序
添加自动启动chkconfig --add mysqldchkconfig mysqld on### Mysql启动成功
来自为知笔记(Wiz)
Mysql 源码安装
标签: