CentOS   发布时间:2022-04-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Centos 6.5下安装MySQL 5.6大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
@H_801_2@

概述

1.下载Linux对应的RPM包 http://dev.mysql.com/downloads/mysql/5.6.html wget http://cdn.mysql.com//Downloads/MySQL-5.6/MySQL-5.6.33-1.el6.x86_64.rpm-bundle.tar 2.解压tar包 tar -xvf MySQL-5.6.33-1.el6.x86_64.rpm-b
@H_801_2@
@H_801_2@ @H_801_2@

1.下载Linux对应的RPM包

http://dev.mysql.com/downloads/mysql/5.6.html

wget http://cdn.@L_616_1@.com//Downloads/@L_616_1@-5.6/@L_616_1@-5.6.33-1.el6.x86_64.rpm-bundle.tar

2.解压tar包

tar -xvf @L_616_1@-5.6.33-1.el6.x86_64.rpm-bundle.tar

3.安装@L_616_1@

rpm -ivh @L_616_1@-server-5.6.33-1.el6.x86_64.rpm 
rpm -ivh @L_616_1@-client-5.6.33-1.el6.x86_64.rpm 
rpm -ivh @L_616_1@-devel-5.6.33-1.el6.x86_64.rpm

如果出现:

error: Failed dependencies:
        libaio.so.1()(64bit) is needed by @L_616_1@-server-5.6.33-1.el6.x86_64
        libaio.so.1(LIBAIO_0.1)(64bit) is needed by @L_616_1@-server-5.6.33-1.el6.x86_64
        libaio.so.1(LIBAIO_0.4)(64bit) is needed by @L_616_1@-server-5.6.33-1.el6.x86_64

下载libaio

yum install libaio

如果出现:

error: Failed dependencies:
        libnuma.so.1()(64bit) is needed by @L_616_1@-server-5.6.33-1.el6.x86_64
        libnuma.so.1(libnuma_1.1)(64bit) is needed by @L_616_1@-server-5.6.33-1.el6.x86_64
        libnuma.so.1(libnuma_1.2)(64bit) is needed by @L_616_1@-server-5.6.33-1.el6.x86_64

下载numactl

yum install numactl
@H_403_131@4.初始化@L_616_1@及设置密码
/usr/bin/@L_616_1@_install_db
@R_618_9260@ce @L_616_1@ start

如果启动失败可能是数据块所在目录没有权限

cat /root/.@L_616_1@_secret  #查看root账号密码
@L_616_1@> SET passworD = passworD('123456');
@L_616_1@> exit

如果.@L_616_1@_secret文件不存在,先停止@L_616_1@进入安全模式设置密码

@R_618_9260@ce @L_616_1@ stop
@L_616_1@d_safe --skip-grant-tables&
@L_616_1@ -u root @L_616_1@
@L_616_1@> updatE user SET password=passworD("new password") WHERE user='root';
@L_616_1@> FLUSH PRIVILEGES;

5.允许远程登陆

@L_616_1@> use @L_616_1@;
@L_616_1@> SELEct host,user,password from user;
@L_616_1@> update user set host='%' where user='root' and host='localhost';
@L_616_1@> flush privileges;
@L_616_1@> exit

6.设置开机自启动

chkconfig @L_616_1@ on
chkconfig --list | grep @L_616_1@
@L_616_1@           0:off   1:off   2:on    3:on    4:on    5:on    6:off
@H_523_197@7.@L_616_1@的认安装位置
/var/lib/@L_616_1@/               #数据库目录
/usr/share/@L_616_1@              #配置文件目录
/usr/bin                     #相关命令目录
/etc/init.d/@L_616_1@              #启动脚本

8.常用命令

1.使用客户端工具连接到数据库

@L_616_1@ -u root -p

2.查看@L_616_1@服务器中包含那些数据库

@L_616_1@>SHOW DATABASES;

3.查看数据库中的数据表信息

@L_616_1@>SHOW TABLES;

4.切换数据库

@L_616_1@>USE @L_616_1@;

5.创建新的数据库

@L_616_1@>CREATE DATABASE 数据库名字;

6.创建新的数据表

@L_616_1@>create table 表名 (字段定义)

7.删除一个数据表

@L_616_1@>drop table 数据库名.表名;

8.删除一个数据库

@L_616_1@>DROP DATABASE 数据库

9.备份整个数据库

@L_616_1@dump -u root -p auth > @L_616_1@-auth.sql

10.备份数据库@L_616_1@中的user表

@L_616_1@dump -u root -p @L_616_1@ user > @L_616_1@.host-user.sql

11.备份@L_616_1@服务器中所有数据库

@L_616_1@dump -u root -p -all-databases > @L_616_1@-all.sql

12.恢复数据库

@L_616_1@ -u root -p [数据库名]< @L_616_1@-all.sql

13.授予用户权限

GRANT 权限列表 ON 数据库名.表名 TO 用户名@来源地址 [IDENTIFIED BY '密码']
GRANT SELECT ON @L_616_1@.user TO daxiong@'localhost' IDENTIFIED BY'123456';
@H_801_2@@H_801_2@

大佬总结

以上是大佬教程为你收集整理的Centos 6.5下安装MySQL 5.6全部内容,希望文章能够帮你解决Centos 6.5下安装MySQL 5.6所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。