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

Centos 安装 mysql

时间:2020-05-26 13:51:08      阅读:328      评论:0      收藏:0      [点我收藏+]

标签:code   chkconfig   ant   get   启动   nbsp   move   rem   arc   

一、检查系统是否安装老版本,有的话干掉
#yum list installed | grep mysql
mysql-libs.x86_64      5.1.73-5.el6_6   @anaconda-CentOS-201508042137.x86_64/6.7


// 卸载某一个 #yum -y remove mysql-libs.x86_64
二、安装及配置
# wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
# rpm -ivh mysql-community-release-el6-5.noarch.rpm
# yum install mysql-community-server -y
检查MySQL状态
service mysqld status
开启MySQL服务
service mysqld start 
重启MySQL服务
# service mysqld restart
设置为开机启动
# chkconfig --list | grep mysqld
# chkconfig mysqld on
设置MySQL密码,第一次登陆不需要密码回车进入;设置本机MySQL密码及远程登录密码:
mysql> use mysql; 
mysql> update user set password=password(你设置的密码) where user=root and host=localhost;  
mysql> GRANT ALL PRIVILEGES ON *.* TO root@% IDENTIFIED BY 你设置的密码 WITH GRANT OPTION;
mysql> flush privileges;
mysql> quit

 

参考自:https://www.cnblogs.com/diandianxinghen/p/12942327.html

Centos 安装 mysql

标签:code   chkconfig   ant   get   启动   nbsp   move   rem   arc   

原文地址:https://www.cnblogs.com/shuaichao/p/12965067.html

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