centos6.8 安装mysql 5.6

一、检查系统是否安装其他版本的MysqL数据
#yum list installed | grep MysqL
#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 repolist all | grep MysqL
安装MysqL数据库
# yum install MysqL-community-server -y
设置为开机启动(2、3、4都是on代表开机自动启动)
# chkconfig --list | grep MysqLd
# chkconfig MysqLd on

三、设置远程root
启动MysqL
# service MysqLd start
设置root密码
# MysqL_secure_installation
登陆root账号
# MysqL -uroot -p 
建立远程root用户
MysqL> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '你设置的密码' WITH GRANT OPTION;
MysqL> flush privileges;

四、设置utf-8编码

查看MysqL原本编码:
MysqL> show variables like 'character%';
设置编码
# vi /etc/my.cnf
如下(少补):

[MysqLd]
character-set-server=utf8 
collation-server=utf8_general_ci 

[MysqL]
default-character-set = utf8

[MysqL.server]
default-character-set = utf8


[MysqLd_safe]
default-character-set = utf8


[client]
default-character-set = utf8

重启MysqL

# service MysqLd restart

再次查看编码:


     # MysqL -uroot -p
MysqL> show variables like 'character%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/MysqL/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)

允许所有外部链接访问(可选)

MysqL -u root -p

MysqL命令行输入

GRANT ALL PRIVILEGES ON *.* TO 'root'@%' IDENTIFIED BY 123456' WITH GRANT OPTION;
FLUSH PRIVILEGES;

参考:http://blog.csdn.net/pengzhenjie36/article/details/75053059(Centos6.8通过yum安装mysql5.7

相关文章

有时候CentOS工作在无互联网的环境下,需要在离线环境下安装一些组件,这次实现的是模拟在离线环境下安...
首先参照https://www.cnblogs.com/wdw984/p/13330074.html,来进行如何安装Centos和离线下载rpm包。 离...
有两个.NET CORE3.1网站部署在CentOS7上(内网IP是192.168.2.32),现在想实现访问http://192.168.2.32...
1、yum -y install vsftpd 安装vsftpd 2、配置vsftpd的配置文件(/etc/vsftpd/vsftpd.conf)主要修改以...
首先去mysql官网下载mysql的离线rpm安装包(https://downloads.mysql.com/archives/community/) Mysql...
第一步下载erlang环境并安装: wget https://packages.erlang-solutions.com/erlang/rpm/centos/7/x86_...