安装mysql 5.5.62_Centos7 下安装MySql5.5.62

首先下载安装包至/OPT目录下

RPM Package, MySQL Server

RPM Package, Client Utilities

查看是否安装mysql

rpm -qa|grep mysql

若没有提示则未安装

出现如下错误需卸载系统自带依赖

warning: MySQL-server-5.5.62-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

file /usr/share/mysql/charsets/README from install of MySQL-server-5.5.62-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64

file /usr/share/mysql/charsets/Index.xml from install of MySQL-server-5.5.62-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64

file /usr/share/mysql/charsets/armscii8.xml from install of MySQL-server-5.5.62-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64

file /usr/share/mysql/charsets/ascii.xml from install of MySQL-server-5.5.62-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64

file /usr/share/mysql/charsets/cp1250.xml from install of MySQL-server-5.5.62-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64

file /usr/share/mysql/charsets/cp1251.xml from install of MySQL-server-5.5.62-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64

file /usr/share/mysql/charsets/cp1256.xml from install of MySQL-server-5.5.62-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64

yum remove mysql-libs

安装命令

rpm -ivh MySQL-server-5.5.62-1.el7.x86_64.rpm

修改mysq密码

/usr/bin/mysqladmin -u root password 123456

设置开机启动

chkconfig mysql on

确认是否随开机自启

chkconfig --list|grep mysql

输入命令后的到如下提示

Note: This output shows SysV services only and does not include native

systemd services. SysV configuration data might be overridden by native

systemd configuration.

If you want to list systemd services use 'systemctl list-unit-files'.

To see services enabled on particular target use

'systemctl list-dependencies [target]'.

mysql 0:off1:off2:on3:on4:on5:on6:off

2,3,4,5表示启动级别,正常情况下启动mysql

复制配置文件

cp my-huge.cnf /etc/my.cnf

重启mysql

service mysql restart

修改字符集

先查看字符集

show variables like 'character%';

show variables like ‘’%char%';

在复制的my.cnf里面修改

[client]内添加

default-character-set=utf-8

[mysqld]内添加

character_set_server=utf8

character_set_client=utf8

collation-server=utf8_general_ci

[mysql]内添加

defaylt-character-set=utf8

重启mysql

alzf.png支付宝扫一扫

wxzf.png微信扫一扫

txzf.png企鹅扫一扫

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值