MySQL 8.0 yum安装和配置
[root@localhost ~]# rpm -qa | grep mariadb
mariadb-libs-5.5.60-1.el7_5.x86_64
yum erase -y mariadb-libs-5.5.60-1.el7_5.x86_64
wget https://repo.mysql.com//mysql80-community-release-el7-1.noarch.rpm
rpm -ivh mysql80-community-release-el7-1.noarch.rpm
yum install -y mysql-community-{server,client,common,libs}-*
systemctl start mysqld
systemctl enable mysqld
[root@localhost ~]# tailf /var/log/mysqld.log
2019-01-12T13:59:34.558708Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.13) initializing of server in progress as process 7038
2019-01-12T13:59:36.873412Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: :ZSytWyMp6Q>
2019-01-12T13:59:38.113827Z 0 [System] [MY-013170] [Server] /usr/sbin/mysqld (mysqld 8.0.13) initializing of server has completed
2019-01-12T13:59:39.798256Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.13) starting as process 7085
2019-01-12T13:59:40.949981Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2019-01-12T13:59:41.019836Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.13' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server - GPL.
2019-01-12T13:59:41.190008Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/var/run/mysqld/mysqlx.sock' bind-address: '::' port: 33060
[root@localhost ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 8.0.13
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
mysql> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql>
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'dgdb20I5';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'dgdB20I5!@#';
Query OK, 0 rows affected (0.02 sec)
mysql>
mysql> select now();
+---------------------+
| now() |
+---------------------+
| 2019-01-12 22:22:19 |
+---------------------+
1 row in set (0.00 sec)
mysql> SHOW GLOBAL VARIABLES LIKE 'log_timestamps';
+----------------+-------+
| Variable_name | Value |
+----------------+-------+
| log_timestamps | UTC |
+----------------+-------+
1 row in set (0.00 sec)
mysql> SET GLOBAL log_timestamps = SYSTEM;
Query OK, 0 rows affected (0.00 sec)
mysql> SHOW GLOBAL VARIABLES LIKE 'log_timestamps';
+----------------+--------+
| Variable_name | Value |
+----------------+--------+
| log_timestamps | SYSTEM |
+----------------+--------+
1 row in set (0.00 sec)
mysql> exit
vim /etc/my.cnf
[mysqld]
log_timestamps=SYSTEM
systemctl restart mysqld
[root@localhost ~]# tailf /var/log/mysqld.log
2019-01-12T13:59:38.113827Z 0 [System] [MY-013170] [Server] /usr/sbin/mysqld (mysqld 8.0.13) initializing of server has completed
2019-01-12T13:59:39.798256Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.13) starting as process 7085
2019-01-12T13:59:40.949981Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2019-01-12T13:59:41.019836Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.13' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server - GPL.
2019-01-12T13:59:41.190008Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/var/run/mysqld/mysqlx.sock' bind-address: '::' port: 33060
2019-01-12T22:29:25.655750+08:00 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.13) MySQL Community Server - GPL.
2019-01-12T22:29:26.338014+08:00 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.13) starting as process 24698
2019-01-12T22:29:26.856796+08:00 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2019-01-12T22:29:26.878264+08:00 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.13' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server - GPL.
2019-01-12T22:29:27.007610+08:00 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/var/run/mysqld/mysqlx.sock' bind-address: '::' port: 33060
mysql> show variables like '%dir%';
+-----------------------------------------+--------------------------------+
| Variable_name | Value |
+-----------------------------------------+--------------------------------+
| basedir | /usr/ |
| binlog_direct_non_transactional_updates | OFF |
| character_sets_dir | /usr/share/mysql-8.0/charsets/ |
| datadir | /var/lib/mysql/ |
| innodb_data_home_dir | |
| innodb_directories | |
| innodb_log_group_home_dir | ./ |
| innodb_max_dirty_pages_pct | 90.000000 |
| innodb_max_dirty_pages_pct_lwm | 10.000000 |
| innodb_temp_tablespaces_dir | ./#innodb_temp/ |
| innodb_tmpdir | |
| innodb_undo_directory | ./ |
| lc_messages_dir | /usr/share/mysql-8.0/ |
| plugin_dir | /usr/lib64/mysql/plugin/ |
| slave_load_tmpdir | /tmp |
| tmpdir | /tmp |
+-----------------------------------------+--------------------------------+
16 rows in set (0.00 sec)
systemctl stop mysqld
mkdir /home/mysql_data
cp -r /var/lib/mysql/* /home/mysql_data/
chown -R mysql:mysql /home/mysql_data
vim /etc/my.cnf
datadir=/home/mysql_data
socket=/home/mysql_data/mysql.sock
#下面这得加上,不然服务能起来,你客户端不能登录
[mysql]
socket=/home/mysql_data/mysql.sock
systemctl start mysqld
[root@localhost my.cnf.d]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.13 MySQL Community Server - GPL
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show variables like '%dir%';
+-----------------------------------------+--------------------------------+
| Variable_name | Value |
+-----------------------------------------+--------------------------------+
| basedir | /usr/ |
| binlog_direct_non_transactional_updates | OFF |
| character_sets_dir | /usr/share/mysql-8.0/charsets/ |
| datadir | /home/mysql_data/ |
| innodb_data_home_dir | |
| innodb_directories | |
| innodb_log_group_home_dir | ./ |
| innodb_max_dirty_pages_pct | 90.000000 |
| innodb_max_dirty_pages_pct_lwm | 10.000000 |
| innodb_temp_tablespaces_dir | ./#innodb_temp/ |
| innodb_tmpdir | |
| innodb_undo_directory | ./ |
| lc_messages_dir | /usr/share/mysql-8.0/ |
| plugin_dir | /usr/lib64/mysql/plugin/ |
| slave_load_tmpdir | /tmp |
| tmpdir | /tmp |
+-----------------------------------------+--------------------------------+
16 rows in set (0.01 sec)
vim /etc/my.cnf
[mysql]
user='root'
password='dgdB20I5!@#'
[root@localhost ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 8.0.13 MySQL Community Server - GPL
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> exit
Bye
[root@localhost ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 8.0.13 MySQL Community Server - GPL
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select host, user, authentication_string, plugin from user;
+-----------+------------------+------------------------------------------------------------------------+-----------------------+
| host | user | authentication_string | plugin |
+-----------+------------------+------------------------------------------------------------------------+-----------------------+
| localhost | mysql.infoschema | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | caching_sha2_password |
| localhost | mysql.session | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | caching_sha2_password |
| localhost | mysql.sys | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | caching_sha2_password |
| localhost | root | $A$005$LP^CZmMk
T4'S0<PcRj0oL/YI9p7IGi1Q59wifPwX/93nRiZez4GboEPK/ | caching_sha2_password |
+-----------+------------------+------------------------------------------------------------------------+-----------------------+
4 rows in set (0.00 sec)
mysql>
vim /etc/my.cnf
[mysqld]
default-authentication-plugin=mysql_native_password
systemctl restart mysqld
mysql> grant all on *.* to 'root'@'%' identified by 'Zhang87073!';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by 'Zhang87073!'' at line 1
#这里先创建一个用户
mysql> create user 'root'@'%' identified by 'Zhang87073!';
Query OK, 0 rows affected (0.06 sec)
#在进行授权
mysql> grant all privileges on *.* to 'root'@'%' with grant option;
Query OK, 0 rows affected (0.05 sec)
#再查看一下
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select host, user, authentication_string, plugin from user;
+-----------+------------------+------------------------------------------------------------------------+-----------------------+
| host | user | authentication_string | plugin |
+-----------+------------------+------------------------------------------------------------------------+-----------------------+
| % | root | *43CAAB27D90B4E33EC75DEEFA02577F7E2BACE93 | mysql_native_password |
| localhost | mysql.infoschema | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | caching_sha2_password |
| localhost | mysql.session | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | caching_sha2_password |
| localhost | mysql.sys | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | caching_sha2_password |
| localhost | root | $A$005$LP^CZmMk
T4'S0<PcRj0oL/YI9p7IGi1Q59wifPwX/93nRiZez4GboEPK/ | caching_sha2_password |
+-----------+------------------+------------------------------------------------------------------------+-----------------------+
5 rows in set (0.00 sec)
mysql> SHOW VARIABLES LIKE 'validate_password%';
+--------------------------------------+--------+
| Variable_name | Value |
+--------------------------------------+--------+
| validate_password.check_user_name | ON |
| validate_password.dictionary_file | |
| validate_password.length | 8 |
| validate_password.mixed_case_count | 1 |
| validate_password.number_count | 1 |
| validate_password.policy | MEDIUM |
| validate_password.special_char_count | 1 |
+--------------------------------------+--------+
7 rows in set (0.00 sec)
mysql > set global validate_password.policy=0;
mysql > set global validate_password.policy=0;
mysql > set global validate_password.length=4;
mysql > set global validate_password.check_user_name=OFF;
mysql > set global validate_password.number_count=0;
mysql > set global validate_password.special_char_count=0;
mysql > flush privileges;
mysql > ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root' ;
mysql > update user set host='%' where user ='root';
MySQL 8.0 yum安装和配置的更多相关文章
- Linux下的 Mysql 8.0 yum 安装 并修改密码
1.MySQL版本: mysql> select @@version;+-----------+| @@version |+-----------+| 8.0.18 |+-----------+ ...
- MySql 8.0.12安装、配置
1. 参考:① 菜鸟教程下载安装MySQl ② 8.0.12安装方法 以下是我遇到的问题: 2.执行 mysqd --initialize --console 后,这个时候运行突然报"无法启 ...
- mysql 5.0.46安装配置
http://os.chinaunix.net/a2008/0801/986/000000986346.shtml RPM包和源码包存放位置 /usr/local/src 源码包编译安装位置(pref ...
- MySQL数据库服务器(YUM)安装
1. 概述2. 部署过程2.1 虚拟机console的NFS服务端配置2.2 虚拟机node15的NFS客户端配置2.3 虚拟机安装MySQL环境2.4 配置MySQL3. 错误及解决3.1 启动失败 ...
- centos7.0 yum 安装php服务器
https://blog.csdn.net/jiaoshenmo/article/details/50923900 首先收一下:centos7.0用yum直接安装apache.php他们的默认版本是a ...
- centos7安装MongoDB4.0(yum安装)
1.添加 yum repo vi /etc/yum.repos.d/mongodb-org-4.0.repo 添加如下内容 [mongodb-org-4.0] name=MongoDB Reposit ...
- MySQL 8.0.20 安装教程图文详解(windows 64位)
MySQL 8.0.20 安装教程图文详解(windows 64位) 更新时间:2020年05月09日 15:09:04 转载 作者:瘦肉粥不加糖 这篇文章主要介绍了MySQL 8.0. ...
- Centos 升级MySQL版本或者Yum安装Mysql5.6
Centos 升级MySQL版本或者Yum安装Mysql5.6 1.从MySQL Yum仓库下载最新的rpm文件:http://dev.mysql.com/downloads/repo/yum/Cen ...
- win10下MYSQL的下载、安装以及配置超详解教程(转)
下载MYSQL 官网下载MYSQL5.7.21版本,链接地址https://www.mysql.com/downloads/.下载流程图如下: 进入官网点击Community,下载社区版. 找到MYS ...
随机推荐
- CSS像素与绝对像素
之前在电视的webview上投放广告页面时,遇到了个问题,就是视窗大小和文档大小不一致.最后发现原来有CSS Pixel这个概念,搜集了一些资料,希望能把这个问题捋捋清楚. 首先提出一个大家常常会忽略 ...
- Typora + Powershell/bash + Git搭建自己的笔记
网上都说什么onenote,evernote,ant等笔记.个人感觉这些都不算太好,还是自己用简易东西搭建一个笔记. 个人推荐使用typora写笔记. 上面既有文件目录,还能通过模糊搜索. 然后需要p ...
- Copy与mutableCopy的个人理解
Copy与mutableCopy的个人理解 1. 相同点 都是将原有对象进行深拷贝(狭义) 这里的狭义上的深拷贝指的是在不考虑编译器在编译时对不可变对象进行copy时采取的优化策略:即将不可变对象的地 ...
- Aangular 父子间组件传递
1.父子间组件传递------重点&难点 Vue.js和Angular中的父子间消息传递原理一样,都可以用口诀: “Props Down,Events Up” 方向1:父 =>子 父组件 ...
- 3.6 Go String型
1. Go String型 Unicode是一种字符集,code point UTF8是unicode的存储实现,转换为字节序列的规则 go的rune类型 可以取出字符串里的unicode 字符串是一 ...
- redis订阅发布功能
发布订阅 案例测试
- PAT-1060 Are They Equal (科学计数法)
1060. Are They Equal If a machine can save only 3 significant digits, the float numbers 12300 and 1 ...
- Pyqt5_Python运用过程中一些问题和技巧
安装python3&pyqt5 1. 网下载python3.7安装包,安装时选择自定义安装,勾选上PIP 直接去官网上下载,一路下一步就可以了,然后将D:\Python37.D ...
- 【HTTP】HTTP报文&状态码
HTTP报文中的HTTP信息 一.编码提升传输速率 编码的好处:有效处理大量的访问请求 编码的弊端:会消耗更多的CPU资源 报文主体&实体主体 报文:HTTP通信的基本单元,8位组字节流组成, ...
- 括号树 noip(csp??) 2019 洛谷 P5658
洛谷AC通道 本题,题目长,但是实际想起来十分简单. 首先,对于树上的每一个后括号,我们很容易知道,他的贡献值等于上一个后括号的贡献值 + 1.(当然,前提是要有人跟他匹配,毕竟题目中要求了,是不同的 ...