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

centos6.8服务器配置之MYSQL配置

时间:2017-09-18 20:38:50      阅读:250      评论:0      收藏:0      [点我收藏+]

标签:word   arc   style   centos   res   local   启动mysql   release   bsp   

1、rpm安装方式顺序:
下载:

wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-community-server-5.7.19-1.el6.x86_64.rpm

安装顺序:

Installing : mysql-community-common-5.7.19-1.el6.x86_64
Installing : mysql-community-libs-5.7.19-1.el6.x86_64
Installing : mysql-community-libs-compat-5.7.19-1.el6.x86_64 
Installing : mysql-community-client-5.7.19-1.el6.x86_64

2、yum安装方式

下载:

wget https://dev.mysql.com/get/mysql57-community-release-el6-11.noarch.rpm

安装:

rpm -ivh mysql57-community-release-el6-11.noarch.rpm
yum -y install mysql-community-server

3、卸载mysql5.7.19

rpm -qa|grep -i mysql
yum remove mysql-community-libs-5.7.19-1.el6.x86_64 mysql-community-client-5.7.19-1.el6.x86_64 mysql57-community-release-el6-11.noarch mysql-community-common-5.7.19-1.el6.x86_64 mysql-community-libs-compat-5.7.19-1.el6.x86_64 mysql-community-server-5.7.19-1.el6.x86_64
whereis mysql //查看安装目录,分别删除

 

4、初始化mysql

#查看是否开机启动
chkconfig --list | grep mysqld
#设为开机启动
chkconfig mysqld on
#启动mysql进行初始化
service mysqld start
#查看密码
grep "password" /var/log/mysqld.log
#进入mysql
mysql -uroot -p密码
#修改密码
set password for root@localhost = password(新密码);

5、修改mysql字符集为UTF-8:

vim /etc/my.cnf; 
在[mysqld]部分添加:character-set-server=utf8;
在文件末尾新增[client]段,并在[client]段添加:default-character-set=utf8

6、重启mysqld服务:

service mysqld restart

 

centos6.8服务器配置之MYSQL配置

标签:word   arc   style   centos   res   local   启动mysql   release   bsp   

原文地址:http://www.cnblogs.com/shangxia/p/7544873.html

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