您的位置:首页 > 运维架构 > Linux

centos6.5安装mysql

2016-05-13 00:00 302 查看
下载mysql地址:http://dev.mysql.com/downloads/mysql/

下载mysql-5.7.11-1.el6.x86_64.rpm-bundle.tar

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
.........

全部安装

service mysqld start

正在启动 mysqld: [确定]
service mysqld stop

mysqld_safe --user=mysql --skip-grant-tables --skip-networking & #进去安全模式

打开另外一个界面

mysql

use mysql #进入mysql库

#初始化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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: