centos6.5安装mysql

下载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

相关文章
相关标签/搜索