mysql 5.7.9 源码安装步骤

软件下载地址: http://dev.mysql.com/downloads/mysql/

源码版安装文件选择如图所示内容(已出5.7.10,截图做为参考):

mysql 5.7.9 源码安装步骤_第1张图片


安装步骤如下:
一. 创建用户并解压安装包
groupadd mysql
useradd mysql -g mysql
tar xvzf mysql-5.7.9-linux-glibc2.5-x86_64.tar.gz -C /home/mysql/
cd /home/mysql/mysql-5.7.9-linux-glibc2.5-x86_64
cd support-files/
cp mysql.server /etc/init.d/mysqld

二. 修改配置文件如下
#vi /etc/my.cnf

[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock
 
# Here follows entries for some specific programs
 
# The MariaDB server
[mysqld]
basedir=/home/mysql/mysql-5.7.9-linux-glibc2.5-x86_64
datadir=/home/mysql/mysql-5.7.9-linux-glibc2.5-x86_64/data
socket=/tmp/mysql.sock
 
#set innodb_buffer_pool_size is 1G
innodb_buffer_pool_size=10737418240
#wait_timeout_seting
interactive_timeout=3600
wait_timeout=3600
innodb_lock_wait_timeout=20
innodb_log_file_size=500M
max_tmp_tables=100
innodb_flush_method=O_DIRECT
innodb_strict_mode=1
max_connections=1000
wait_timeout=180
character-set-server=utf8
server-id=1
log_bin
binlog_format = row
expire_logs_days=7
innodb_file_per_table=1
event_scheduler=1
skip-name-resolve
lower_case_table_names=1
explicit_defaults_for_timestamp


三.mysql 初始化安装
/home/mysql/mysql-5.7.9-linux-glibc2.5-x86_64/bin/mysqld --defaults-file=/etc/my.cnf --initialize-insecure --user=mysql  --basedir=/home/mysql/mysql-5.7.9-linux-glibc2.5-x86_64 --datadir=/home/mysql/mysql-5.7.9-linux-glibc2.5-x86_64/data
##生成的root密码默认为空

四 . 将 mysql 加入开机启动
chmod +x /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig --level 345 mysqld on

五. 启动 mysql
service mysqld start

六.修改管理员密码:
mysql -u root --skip-password
ALTER USER 'root'@'localhost' IDENTIFIED BY 'mysql@123 ';

七.如果需要另外新加账户,进入mysql,授权即可
mysql> grant all privileges on *.* to root@'%' identified by 'mysql@123 ' with grant option;
flush privileges;


你可能感兴趣的:(mysql 5.7.9 源码安装步骤)