4、创建mysql的用户组和用户,并对mysql目录设置用户组和用户
[iyunv@localhost local]# groupadd mysql
[iyunv@localhost local]# useradd mysql -g mysql
[iyunv@localhost local]# cd mysql
[iyunv@localhost mysql]# pwd
/usr/local/mysql
[iyunv@localhost mysql]# chown -R mysql .
[iyunv@localhost mysql]# chgrp -R mysql .
6、登录mysql,此版本最新版不许空密码登录,实际上有个初始化密码保存在/root/.mysql_secret这个文件里面,用这个密码第一次登录后,再修改密码。因此先cat查看下初始化密码(随机的,每次安装看到的密码都不一样):
[iyunv@localhost ~]# cat /root/.mysql_secret
# Password set for user 'root@localhost' at 2016-01-09 12:00:28
:5ul#H6dmcwX
利用初始化密码:5ul#H6dmcwX开始登录mysql:
[iyunv@localhost ~]# cd /usr/local/mysql/bin
[iyunv@localhost bin]# ./mysql -uroot -p:5ul#H6dmcwX
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.10
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.