MySQL 5.7.9源码编译安装说明(3)

2015-10-29T21:59:00.398966Z 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: 42ad8740-7e88-11e5-83de-000c29270868.

2015-10-29T21:59:00.406427Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.

2015-10-29T21:59:00.424627Z 1 [Note] A temporary password is generated for root@localhost: Ek&!sA9(qYds

[root@mdb01 mysql]# ls

bin  COPYING  data  docs  include  INSTALL-BINARY  lib  man  mysql-test  README  share  support-files

[root@mdb01 mysql]#

3.证书相关

shell> bin/mysql_ssl_rsa_setup              # MySQL 5.7.6 and up

执行结果

[root@mdb01 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@mdb01 mysql]#

4.目录权限修改

shell> chown -R root .

shell> chown -R mysql data

Basedir mysql user

[root@mdb01 mysql-5.7.9]# cd /opt

[root@mdb01 opt]# chown mysql mysql

[root@mdb01 opt]# ll

total 4

drwxr-xr-x. 11 mysql mysql 4096 Oct 30 06:09 mysql

5.启动 MySQL

shell> bin/mysqld_safe --user=mysql &

六、首次登陆 MySQL

1.登录MySQL

[root@rhel6 mysql]# bin/mysql -u root -p

Enter password: 安装时生成的临时密码(Ek&!sA9(qYds)

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 3

Server version: 5.7.9-log

Copyright (c) 2000, 2015, 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>

2.修改登录密码root密码

* As of MySQL 5.7.6, use ALTER USER:

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';

Query OK, 0 rows affected (0.02 sec)

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

3.配置启动项

# Next command is optional

shell> cp support-files/mysql.server /etc/init.d/mysqld

PATH环境变量

vi /etc/profile

.....

.....

unset i

unset pathmunge

export PATH=/opt/mysql/bin:$PATH

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/7c2f3d5f88b79265c3f0861b76147f16.html