centos7 安装 5.6.35 MySQL Community Server

  由于Centos7版本从默认程序列表中移除了MySql,需要从官网下载安装mysql:

# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
# rpm -ivh mysql-community-release-el7-5.noarch.rpm
# yum install mysql-community-serve


启动MySQl服务:

# service mysqld start

登录进Mysql(刚开始进入时是没有密码的)
#mysql -uroot

设置登录密码
mysql> set password for 'root'@'localhost' = password('yourPassword');

添加远程登录用户
mysql> grant all privileges on *.* to 'root'@'%' identified by 'yourPassword';

远程登录
#mysql -uroot -h ip(远程的ip地址) -p


Mysql中文编码设置(设置为utf8):
1.关闭 mysql服务,打开mysql配置文件/etc/my.cnf
#service mysqld stop
#vim /etc/my.cnf

2.修改/etc/my.cnf
在[mysqld]标签下添加
character_set_server = utf8

在[mysqld_safe]标签下添加
default-character-set = utf8

添加[mysql]标签并在该标签下添加
default-character-set = utf8

3.重启mysql服务
#service mysqld restart

4.登录进mysql,查看mysql的编码
#show variables like '%character%';

 







转载于:https://www.cnblogs.com/TeiSi/p/6560282.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值