码迷,mamicode.com
首页 > 数据库 > 详细

centos6.5 mysql 安装

时间:2018-01-06 11:59:12      阅读:245      评论:0      收藏:0      [点我收藏+]

标签:密码   查找   centos   root   检测   unit   post   code   x86   

1.检测系统是否自带安装mysql

 yum list installed | grep mysql

2.删除系统自带的mysql及其依赖

yum -y remove mysql-libs.x86_64

3.给CentOS添加rpm源,并且选择较新的源

wget dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
yum localinstall mysql-community-release-el6-5.noarch.rpm
yum repolist all | grep mysql
yum-config-manager --disable mysql55-community
yum-config-manager --disable mysql56-community
yum-config-manager --enable mysql57-community-dmr
yum repolist enabled | grep mysql

4.安装mysql 服务器

yum install mysql-community-server

5.启动mysql

service mysqld start

6.查看mysql是否自启动,并且设置开启自启动

chkconfig --list | grep mysqld
chkconfig mysqld on

7.mysql安全设置

mysql_secure_installation

8.临时密码

5.7.10现在已经不用mysql_secure_installation命令初始化密码了,
又保存在临时文件里:/var/log/mysqld.log,
可以用grep ‘temporary password‘ /var/log/mysqld.log查找 

9.设置外网可访问

GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY ‘1234567‘ WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY ‘1234567‘ WITH GRANT OPTION;

flush privileges;

centos6.5 mysql 安装

标签:密码   查找   centos   root   检测   unit   post   code   x86   

原文地址:https://www.cnblogs.com/snakejia/p/8213268.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!