mysql 5.7.18 安装配置方法图文教程(CentOS7)


本文整理自网络,侵删。

介绍如何在Linux下安装MySQL 5.7.18

1、下载MySQL:官网https://www.mysql.com/,点击Downlosas,翻到网页底部,下载社区版,一路点下去,选择通用Linux,下载64位那个,注意检查MD5
值。

2、安装关键步骤,直接贴出命令

[cpp] view plain copy 在CODE上查看代码片派生到我的代码片
[root@CentOS MySQL]# tar -xzvf mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz -C /usr/local 
[root@CentOS MySQL]# cd /usr/local 
[root@CentOS local]# mv mysql-5.7.17-linux-glibc2.5-x86_64 mysql 
[root@CentOS local]# cd mysql 
[root@CentOS mysql]# mkdir data 
[root@CentOS mysql]# groupadd mysql 
[root@CentOS mysql]# useradd -r -g mysql -s/bin/false mysql 
[root@CentOS mysql]# chown -R mysql:mysql ./ 
[root@CentOS mysql]# bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data 
2017-02-23T07:43:03.404885Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 
2017-02- 
 
23T07:43:04.442174Z 0 [Warning] InnoDB: New log files created, LSN=45790 
2017-02-23T07:43:04.588507Z 0 [Warning] InnoDB: Creating foreign key constraint system tables. 
2017-02-23T07:43:04.646721Z 0 [Warning] No 
 
existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: b5c8e226-f99b-11e6-beb5-b7c1a1e39029. 
2017-02-23T07:43:04.671492Z 0 [Warning] 
 
Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened. 
2017-02-23T07:43:04.672338Z 1 [Note] A temporary password is generated for root@localhost: I%e=s+lfx9ko 
[root@CentOS mysql]# 
 
bin/mysql_ssl_rsa_setup --datadir=/usr/local/mysql/data 
Generating a 2048 bit RSA private key 
.....................................+++ 
..............................+++ 
writing new private key to 'ca-key.pem' 
----- 
Generating a 2048 bit RSA private key 
.........................................+++ 
.........................+++ 
writing new private key to 'server-key.pem' 
----- 
Generating a 2048 bit RSA private key 
..................................................+++ 
...................................................................................................................................................................................................+++ 
writing 
 
new private key to 'client-key.pem' 
----- 
[root@CentOS mysql]# cd support-files 
[root@CentOS support-files]# cp my-default.cnf /etc/my.cnf 
[root@CentOS support-files]# gedit /etc/my.cnf 
[root@CentOS support-files]# cp mysql.server /etc/init.d/mysqld 
[root@CentOS support-files]# service mysqld start 
Starting MySQL.Logging to '/usr/local/mysql/data/CentOS.cn.err'. 
. SUCCESS! 
[root@CentOS support-files]# ps aux |grep mysql 
root  18279 0.0 0.0 11764 1576 pts/0 S 17:34 0:00 /bin/sh 
 
/usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/CentOS.cn.pid 
mysql  18449 1.9 9.5 1182688 177940 pts/0 Sl 17:34 0:00 /usr/local/mysql/bin/mysqld -- 
 
basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/CentOS.cn.err --pid-file=/usr/local/mysql/data/CentOS.cn.pid 
 
--socket=/tmp/mysql.sock --port=3306 
 
[root@CentOS support-files]# 

一行一行解释:

阅读剩余部分

相关阅读 >>

linux上优化mysql技巧

理解mysql变量和条件

mysql中常见的日志问题介绍

mysql中mul是什么意思

mysql环境变量如何配置

通过grep 获取mysql错误日志信息的方法代码示例

mysql的主键命名策略相关

mysql双向备份的方法介绍(附代码)

mysql如何安装和运行

mysql如何配置及mysql服务无法启动

更多相关阅读请进入《mysql》频道 >>


数据库系统概念 第6版
书籍

数据库系统概念 第6版

机械工业出版社

本书主要讲述了数据模型、基于对象的数据库和XML、数据存储和查询、事务管理、体系结构等方面的内容。



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...