下載mysql地址:http://dev.mysql.com/downloads/mysql/mysql
下載mysql-5.7.11-1.el6.x86_64.rpm-bundle.tarsql
mysql-community-client-5.7.11-1.el6.x86_64
mysql-community-common-5.7.11-1.el6.x86_64
mysql-community-devel-5.7.11-1.el6.x86_64
mysql-community-server-5.7.11-1.el6.x86_64
mysql-community-libs-5.7.11-1.el6.x86_64
.........安全
所有安裝this
service mysqld startserver
正在啓動 mysqld: [肯定]
service mysqld stopip
mysqld_safe --user=mysql --skip-grant-tables --skip-networking & #進去安全模式get
打開另一個界面input
mysqlstring
use mysql #進入mysql庫it
#初始化mysql
update mysql.user set authentication_string=password('123456') where user='root' and Host ='localhost';
Query OK, 1 row affected, 1 warning (0.19 sec)
Rows matched: 1 Changed: 1 Warnings: 1
初始化成功
flush privileges;
exit
從新啓動mysql
service mysqld start
mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.7.11
Copyright (c) 2000, 2016, 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.
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
SET PASSWORD = PASSWORD('123456');
exit
登錄密碼用123456