centos安裝mysql5.7的簡單過程


[root@localhost mysql5.7.28]# rpm -ivh mysql-community-common-5.7.28-1.el6.x86_64.rpm
warning: mysql-community-common-5.7.28-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                ########################################### [100%]
   1:mysql-community-common ########################################### [100%]
[root@localhost mysql5.7.28]# rpm -ivh mysql-community-client-5.7.28-1.el6.x86_64.rpm
warning: mysql-community-client-5.7.28-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
        mysql-community-libs(x86-64) >= 5.7.9 is needed by mysql-community-client-5.7.28-1.el6.x86_64
[root@localhost mysql5.7.28]# rpm -ivh mysql-community-libs-5.7.28-1.el6.x86_64.rpm
warning: mysql-community-libs-5.7.28-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                ########################################### [100%]
   1:mysql-community-libs   ########################################### [100%]
[root@localhost mysql5.7.28]# rpm -ivh mysql-community-client-5.7.28-1.el6.x86_64.rpm
warning: mysql-community-client-5.7.28-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                ########################################### [100%]
   1:mysql-community-client ########################################### [100%]
[root@localhost mysql5.7.28]# rpm -ivh mysql-community-server-5.7.28-1.el6.x86_64.rpm
warning: mysql-community-server-5.7.28-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                ########################################### [100%]
   1:mysql-community-server ########################################### [100%]
[root@localhost mysql5.7.28]# mysqld --initialize --user=mysql
2019-12-03T21:54:48.492762Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-12-03T21:54:48.498886Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2019-12-03T21:54:48.498917Z 0 [ERROR] Aborting
[root@localhost mysql]# rm -rf /var/lib/mysql/*
 [root@localhost mysql]# mysqld --initialize --user=mysql
[root@localhost mysql]# ls
auto.cnf    ca.pem           client-key.pem  ibdata1      ib_logfile1  performance_schema  public_key.pem   server-key.pem
ca-key.pem  client-cert.pem  ib_buffer_pool  ib_logfile0  mysql        private_key.pem     server-cert.pem  sys
[root@localhost mysql]# cat /var/log/mysqld.log
2019-12-07T02:49:11.330655Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-12-07T02:49:11.598340Z 0 [Warning] InnoDB: New log files created, LSN=45790
2019-12-07T02:49:11.645526Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2019-12-07T02:49:11.713576Z 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: 25d88ebb-189c-11ea-85ad-000c29c71012.
2019-12-07T02:49:11.724505Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2019-12-07T02:49:12.528357Z 0 [Warning] CA certificate ca.pem is self signed.
2019-12-07T02:49:12.891475Z 1 [Note] A temporary password is generated for root@localhost: gL/xel<2qahv
[root@localhost mysql]# chkconfig --list|grep mysql
mysqld          0:off   1:off   2:off   3:on    4:on    5:on    6:off
[root@localhost mysql]# service mysqld start
Starting mysqld:                                           [  OK  ]
[root@localhost mysql]# mysql -uroot -p"gL/xel<2qahv"
mysql> set password for root@'localhost'=password('root');
Query OK, 0 rows affected, 1 warning (0.01 sec)
mysql> select version();
+-----------+
| version() |
+-----------+
| 5.7.28    |
+-----------+
1 row in set (0.00 sec)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章