CentOS6.5下RPM方式安装mysql5.6.33

2018-06-17 23:04:53来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折

1、mysql下载

下载地址:https://dev.mysql.com/downloads/mysql/5.6.html
下载以下安装包: MySQL-client-5.6.33-1.el6.x86_64.rpm MySQL-devel-5.6.33-1.el6.x86_64.rpm MySQL-server-5.6.33-1.el6.x86_64.rpm

2、查看是否已经安装了mysql,有则移除

rpm -qa|grep -i mysql
mysql-libs-5.1.66-2.el6_3.x86_64
yum -y remove mysql-libs*

3、安装mysql5.6

rpm -ivh MySQL-client-5.6.33-1.el6.x86_64.rpm
rpm -ivh MySQL-devel-5.6.33-1.el6.x86_64.rpm
rpm -ivh MySQL-server-5.6.33-1.el6.x86_64.rpm
cp /usr/share/mysql/my-default.cnf /etc/my.cn

4、初始化MySQL及设置密码

/usr/bin/mysql_install_db
service mysql start
cat /root/.mysql_secret
mysql -uroot -p初始密码
set PASSWORD=PASSWORD('123456');
exit

5、开启远程访问

mysql -uroot -p123456
use mysql;
update user set password=password('123456') where user='root';
update user set host='%' where user='root' and host='localhost';
flush privileges;
exit

6、设置开机自启动

chkconfig mysql on

7、优化my.cnf配置

vim /etc/my.cnf

[mysqld]
port = 3306
default-storage-engine = InnoDB 
lower_case_table_names = 1 
max-connections=3000
character_set_server=utf8
[mysql]  
default-character-set=utf8 

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:Mysql压缩包版的安装方法详解

下一篇:mysql 触发器更新当前行