源码安装Mysql5.7
Linux Mysql务器安装
关系型数据库:MySQL、MaraiDB、Oracle、SQL Server、PostgreSQL、DB2
MySQL引擎包括:ISAM、MyISAM、InnoDB、Memory、CSV、BlackHole、Archive、Performance_Schema、Berkeley、Federated、Cluster/NDB
Mysql服务器安装YUM/rpm mysql5.7.16-10
yum install mysql-server mysql-devel mysql-libs -y CentOS 6.X版本
yum install mariadb-server mariadb mariadb-libs -y CentOS 7.X版本
Mysql服务器安装源码
http://down1.chinaunix.net/distfiles/mysql-5.5.20.tar.gz
wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.25-linux-glibc2.12-x86_64.tar.gz
yum install cmake ncurses - devel ncurses -y
yum install -y cmake make gcc gcc-c++ libaio ncurses ncurses-devel
解压安装包
tar -zxvf mysql-5.7.25-linux-glibc2.12-x86_64.tar.gz
将解压的复制到 /usr/local/mysql 目录
cp -r mysql-5.7.25-linux-glibc2.12-x86_64 /usr/local/mysql
添加mysql组和mysql用户
groupadd mysql
useradd -r -g mysql mysql
安装数据库
cd /usr/local/mysql/ 切换至软件包目录
chown -R mysql:mysql ./ 修改当前目录拥有者为mysql
mkdir data
bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
数据库初始密码为:G!jPM#Kh,4pq
创建RSA private key
bin/mysql_ssl_rsa_setup --datadir=/usr/local/mysql/data
chown -R mysql:mysql ./ 修改当前目录拥有者为mysql
chown -R mysql:mysql data 修改data目录拥有者为mysql
修改数据库字符集
vim /etc/my.cnf
character-set-server=utf8 行首加入
init_connect=‘SET NAMES utf8
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
#不区分大小写
lower_case_table_names = 1
#不开启sql严格模式
sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
log-error=/var/log/mysqld.log
pid-file=/usr/local/mysql/data/mysqld.pid
添加开机启动
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
修改启动文件
vim /etc/init.d/mysqld
cd /var/lib/mysql/ ;mkdir mysql
加入开机启动
chkconfig --add mysqld
添加软链接
ln -s /usr/local/mysql/bin/mysql /usr/bin
启动mysql
关系型数据库:MySQL、MaraiDB、Oracle、SQL Server、PostgreSQL、DB2
MySQL引擎包括:ISAM、MyISAM、InnoDB、Memory、CSV、BlackHole、Archive、Performance_Schema、Berkeley、Federated、Cluster/NDB
Mysql服务器安装YUM/rpm mysql5.7.16-10
yum install mysql-server mysql-devel mysql-libs -y CentOS 6.X版本
yum install mariadb-server mariadb mariadb-libs -y CentOS 7.X版本
Mysql服务器安装源码
http://down1.chinaunix.net/distfiles/mysql-5.5.20.tar.gz
wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.25-linux-glibc2.12-x86_64.tar.gz
yum install cmake ncurses - devel ncurses -y
yum install -y cmake make gcc gcc-c++ libaio ncurses ncurses-devel
解压安装包
tar -zxvf mysql-5.7.25-linux-glibc2.12-x86_64.tar.gz
将解压的复制到 /usr/local/mysql 目录
cp -r mysql-5.7.25-linux-glibc2.12-x86_64 /usr/local/mysql
添加mysql组和mysql用户
groupadd mysql
useradd -r -g mysql mysql
安装数据库
cd /usr/local/mysql/ 切换至软件包目录
chown -R mysql:mysql ./ 修改当前目录拥有者为mysql
mkdir data
bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
数据库初始密码为:G!jPM#Kh,4pq
创建RSA private key
bin/mysql_ssl_rsa_setup --datadir=/usr/local/mysql/data
chown -R mysql:mysql ./ 修改当前目录拥有者为mysql
chown -R mysql:mysql data 修改data目录拥有者为mysql
修改数据库字符集
vim /etc/my.cnf
character-set-server=utf8 行首加入
init_connect=‘SET NAMES utf8
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
#不区分大小写
lower_case_table_names = 1
#不开启sql严格模式
sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
log-error=/var/log/mysqld.log
pid-file=/usr/local/mysql/data/mysqld.pid
添加开机启动
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
修改启动文件
vim /etc/init.d/mysqld
cd /var/lib/mysql/ ;mkdir mysql
加入开机启动
chkconfig --add mysqld
添加软链接
ln -s /usr/local/mysql/bin/mysql /usr/bin
启动mysql
相关推荐
瓜牛呱呱 2020-11-12
柳木木的IT 2020-11-04
yifouhu 2020-11-02
lei0 2020-11-02
源码zanqunet 2020-10-28
源码zanqunet 2020-10-26
一叶梧桐 2020-10-14
码代码的陈同学 2020-10-14
lukezhong 2020-10-14
lzzyok 2020-10-10
anchongnanzi 2020-09-21
clh0 2020-09-18
changcongying 2020-09-17
星辰大海的路上 2020-09-13
abfdada 2020-08-26
mzy000 2020-08-24
shenlanse 2020-08-18
zhujiangtaotaise 2020-08-18
xiemanR 2020-08-17