2018-10-24T04:25:13.673365Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-10-24T04:25:15.808961Z 0 [Warning] InnoDB: New log files created, LSN=457902018-10-24T04:25:16.105505Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2018-10-24T04:25:16.184776Z 0 [Warning] No existing UUID has been found, so we assume that thisis the first time that this server has been started. Generating a new UUID: cec94f21-d744-11e8-a0b5-fa163ed8e403.
2018-10-24T04:25:16.188372Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2018-10-24T04:25:16.189074Z 1 [Note] A temporary password is generated for root@localhost: i;lknXwO;5,s
[root@baidu64 mysql]#
[root@baidu64 mysql]# chkconfig --add mysqld
[root@baidu64 mysql]# chkconfig --list mysqld
Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration.
If you want to list systemd services use 'systemctl list-unit-files'.
To see services enabled on particular target use
'systemctl list-dependencies [target]'.mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@baidu64 mysql]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is5
Server version: 5.7.18Copyright (c) 2000, 2017, 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> SET PASSWORD = PASSWORD('123456');
Query OK, 0 rows affected, 1 warning (0.00 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 -ADatabase changed
mysql> update user set authentication_string=PASSWORD('123456') where User='root';
Query OK, 0 rows affected, 1 warning (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 1mysql>
?
3.4 允許遠(yuǎn)程訪問(wèn)
mysql> grant all privileges on *.* to root@"%" identified by "password" with grant option;
Query OK, 0 rows affected, 1 warning (0.00 sec)mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)mysql>
[root@baidu64 mysql]# service mysql restart
Redirecting to /bin/systemctl restart mysql.service
?
3.5.4 無(wú)密碼登錄mysql 注意: 此時(shí)登錄不帶p參數(shù):
[root@baidu64 mysql]# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is3
Server version: 5.7.18 MySQL Community Server (GPL)Copyright (c) 2000, 2017, 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>
?
3.5.5 再次修改mysql密碼:
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 -ADatabase changed
mysql> update mysql.user set authentication_string=password('123456') where user='root' ;
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 2 Changed: 1 Warnings: 1mysql>