┌─────────────────────────────────────────┤ Configuring mysql-server-5.7 ├─────────────────────────────────────────┐ │ While not mandatory, it is highly recommended that you set a password for the MySQL administrative "root" user. │ │ │ │ If this field is left blank, the password will not be changed. │ │ │ │ New password for the MySQL "root" user: │ │ │ │ ________________________________________________________________________________________________________________ │ │ │ │ <Ok> │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
密码输入完后,按 [shift+enter] 进行确定 !!!
重启服务
1
service mysql restart
查看服务状态
1
service mysql status
服务开启输出的内容
1 2 3 4 5 6 7 8
● mysql.service - MySQL Community Server Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2018-12-13 14:36:48 CST; 15s ago Process: 26464 ExecStartPost=/usr/share/mysql/mysql-systemd-start post (code=exited, status=0/SUCCESS) Process: 26450 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS) Main PID: 26462 (mysqld) CGroup: /system.slice/mysql.service └─26462 /usr/sbin/mysqld