[root@n5 mysql]# mysqld --initialize-insecure --user=mysql --datadir=/data/mysql --basedir=/usr/local/mysql
2018-04-13T05:28:25.149583Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-04-13T05:28:25.948412Z 0 [Warning] InnoDB: New log files created, LSN=45790
2018-04-13T05:28:26.058553Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2018-04-13T05:28:26.121981Z 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: 7da0526b-3edb-11e8-a71c-000c2977a305.
2018-04-13T05:28:26.124459Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2018-04-13T05:28:26.127938Z 1 [Warning] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
[root@n5 mysql]# service mysql start #開啟mysql服務
Redirecting to /bin/systemctl start mysql.service
[root@n5 mysql]# mysql #運行mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
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>