mysql笔记

 

基础知识

https://www.jianshu.com/p/b83d56d2b6fc

 

安装mysql5.7

参考文档:

https://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/

[root@test ~]# wget https://repo.mysql.com//mysql80-community-release-el7-1.noarch.rpm

--2018-09-18 14:56:31--  https://repo.mysql.com//mysql80-community-release-el7-1.noarch.rpm

Resolving repo.mysql.com (repo.mysql.com)... 23.52.176.229

Connecting to repo.mysql.com (repo.mysql.com)|23.52.176.229|:443... connected.

HTTP request sent, awaiting response... 200 OK

Length: 25820 (25K) [application/x-redhat-package-manager]

Saving to: ‘mysql80-community-release-el7-1.noarch.rpm’

 

100%[=====================================================================>] 25,820      --.-K/s   in 0.1s    

 

2018-09-18 14:56:37 (190 KB/s) - ‘mysql80-community-release-el7-1.noarch.rpm’ saved [25820/25820]

 

[root@test ~]# ls

111.pcap  123.pcap  anaconda-ks.cfg  cap.pcap  get-pip.py  go  mysql80-community-release-el7-1.noarch.rpm  ntp_123.csv

[root@test ~]#

 

[root@test ~]# rpm -Uvh mysql80-community-release-el6-n.noarch.rpm

error: open of mysql80-community-release-el6-n.noarch.rpm failed: No such file or directory

[root@test ~]# rpm -Uvh mysql80-community-release-el7-1.noarch.rpm

warning: mysql80-community-release-el7-1.noarch.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing...                          ################################# [100%]

Updating / installing...

   1:mysql80-community-release-el7-1  ################################# [100%]

[root@test ~]#vim /etc/yum.repos.d/mysql-community.repo

使能安装mysql57,去使能mysql80

# Enable to use MySQL 5.7

[mysql57-community]

name=MySQL 5.7 Community Server

baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

 

[mysql80-community]

name=MySQL 8.0 Community Server

baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/7/$basearch/

enabled=0

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

 

[root@test ~]#yum -y install mysql-community-server

获取初始密码:

修改密码:

 

修改db的字符集、开启bin日志功能、修改@@sql_mode的my.cnf配置文件内容:

[root@localhost ~]# cat /etc/my.cnf

# For advice on how to change settings please see

# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html

 

 

[mysqld]

character-set-server=utf8

#

# Remove leading # and set to the amount of RAM for the most important data

# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.

# innodb_buffer_pool_size = 128M

#

# Remove leading # to turn on a very important data integrity option: logging

# ch

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值