[root@iZwz94knyxhkgqeu5pve0zZ bin]# cd /usr/local/mysql
[root@iZwz94knyxhkgqeu5pve0zZ mysql]# bin/mysqld --initialize --user=mysql --basedir=/u
sr/local/mysql
2017-04-21T01:09:02.837622Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-04-21T01:09:05.621663Z 0 [Warning] InnoDB: New log files created, LSN=45790
2017-04-21T01:09:06.007022Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2017-04-21T01:09:06.103758Z 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: 1da93999-262f-11e7-a713-00163e06a307.
2017-04-21T01:09:06.109542Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2017-04-21T01:09:06.110557Z 1 [Note] A temporary password is generated for root@localhost: MX,)LrHRq6gn
[root@iZwz94knyxhkgqeu5pve0zZ mysql]# bin/mysql_ssl_rsa_setup
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@iZwz94knyxhkgqeu5pve0zZ mysql]# cd /usr/local/mysql/support-files
[root@iZwz94knyxhkgqeu5pve0zZ support-files]# cp my-default.cnf /etc/my.cnf
[root@iZwz94knyxhkgqeu5pve0zZ support-files]# cp mysql.server /etc/init.d/mysql
[root@iZwz94knyxhkgqeu5pve0zZ support-files]# vim /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
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
[mysqld]
# 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
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = .....
# socket = .....
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
~
~
~
~
~
~
~
"/etc/my.cnf" 31L, 1126C 1,1 All
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
[mysqld]
# 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
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required.
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
port = 3306
# server_id = .....
socket = /tmp/mysql.sock
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
~
~
~
~
~
~
~
"/etc/my.cnf" 31L, 1154C written
[root@iZwz94knyxhkgqeu5pve0zZ support-files]# cd ../
[root@iZwz94knyxhkgqeu5pve0zZ mysql]# bin/mysqld-safe --user=mysql &
[1] 21491
[root@iZwz94knyxhkgqeu5pve0zZ mysql]# cd data
[root@iZwz94knyxhkgqeu5pve0zZ data]# chmod a+rw server-key.pem
[root@iZwz94knyxhkgqeu5pve0zZ data]# cd ../
[root@iZwz94knyxhkgqeu5pve0zZ mysql]# bin/mysqld_safe --user=mysql &
[2] 21686
[root@iZwz94knyxhkgqeu5pve0zZ mysql]# bin/mysql --user=root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[root@iZwz94knyxhkgqeu5pve0zZ mysql]# bin/mysql --user=root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.7.16
Copyright (c) 2000, 2016, 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> set password=password('123456');
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> grant all privileges on *.* to root@'%' identified by '123456';
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
另外启动一个窗口,/etc/profile文件修改添加一句话export PATH=/usr/local/mysql/bin:$PATH
vim /etc/profile的过程省略
[root@iZwz94knyxhkgqeu5pve0zZ ~]# source /etc/profile
[root@iZwz94knyxhkgqeu5pve0zZ ~]# chmod 755 /etc/init.d/mysql
[root@iZwz94knyxhkgqeu5pve0zZ ~]# chkconfig --add mysql
[root@iZwz94knyxhkgqeu5pve0zZ ~]# chkconfig --level 345 mysql on
注意绿色的字体是生成的mysql初始化密码啊
结束
相关推荐
主要为大家详细介绍了Linux学习第三篇,Centos7安装mysql5.7.16数据库,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
Centos6.7+MySQL5.7.16源码编译安装.doc
1. 从官网下载 mysql-5.7.13-linux-glibc2.5-x86_64.tar.gz 经测试, 本文还适用于如下版本: MySQL-5.7.10-Linux-glibc2.5-x86_64.tar.gz mysql-5.7.11-linux-glibc2.5-x86_64....2.检查你所用的Linux下有没有安装过my
主要介绍了centos7环境下源码安装mysql5.7.16的方法,详细分析了centos7环境下MySQL安装的相关步骤、操作命令、配置方法与注意事项,需要的朋友可以参考下
主要介绍了CentOS 7.3.1611编译安装Nginx1.10.3+MySQL5.7.16+PHP7.1.2,需要的朋友可以参考下
之前写了一份,感觉有些不全,但又不能删除,现在重新完善了一下
今天带大家来安装一下mysql,并修改一下mysql的相关配置,并且授予远程登录权限,在window上的数据库管理工具上操纵linux上的数据库。在安装前最好先保存一份快照,以防安装过程中出现问题。 1、检查,卸载系统自带...
centos6.5 安装mysql5.7.19的详细步骤,具体内容如下 1、从oracle网站上下载mysql5.7.19 2、增加centos用户组及用户 MySQL groupadd mysql useradd mysql -g mysql 3、把需要安装的文件进行解压到指定的目录...
帮助大家快速安装mysql,无盲点。 需要提前部署好服务器的操作系统centos 6.5,本文使用的是64位的操作系统 2,MySQL的安装包,需要提前下载好,mysql-5.7.16-linux-glibc2.5-x86_64.tar.gz 3,MySQL的软件依赖包,...
主要介绍了CentOS 7.x编译安装Nginx1.10.3+MySQL5.7.16+PHP5.2 5.3 5.4 5.5 5.6 7.0 7.1多版本全能环境,需要的朋友可以参考下
MySQL版本:MySQL5.7.16 该文档适用于MySQL版本>=5.7.6 一、卸载CentOS7默认携带的mariadb包 # 检查mariadb安装包 [root@wing ~]# rpm -qa | grep -i mysql [root@wing ~]# rpm -qa | grep -i mariadb mariadb-...
Centos7+Nginx1.11.7+MySQL5.7.16+PHP7.1.0+openssl-1.1.0c 一、linux 系统限制配置 1、关闭系统防火墙 systemctl stop firewalld.service 关闭防火墙 systemctl disable firewalld.service 禁用防火墙 2、关闭...