mysql 5.6.38 安装(redhat 6)
2018-01-21 21:32
211 查看
本文只适用于通过 rpm 二进制的方式安装,使用源码安装的请自行百度。
1. 准备步骤
下载地址 :https://dev.mysql.com/downloads/mysql/5.6.html只需要以下安装文件
MySQL-client*.rpm MySQL-devel*.rpm MySQL-server*.rpm
需要使用 root 的账号进行操作
2. 卸载
卸载包
找出所有已经安装的包rpm -qa | grep -i mysql
移除上面命令列出来的包
rpm -e pagename --nodeps 参数 pagename 上面出现的包名 参数 --nodeps 表示不检查依赖进行删除
删除文件
查找 mysql 的文件find / -name mysql
删除
rm -rf folderORFileNamw
3. 安装
安装软件
依次执行rpm -ivh MySQL-devel*.rpm rpm -ivh MySQL-client*.rpm rpm -ivh MySQL-server*.rpm
此时安装完成后 mysql 已经自动启动。查看是否启动成功可以使用
lsof -i:3306来查看。
配置 my.cnf
使用命令find / -name my-default.cnf找到此文件。
复制配置文件到
/etc/目录下
cp thisFilePath/my-default.cnf /etc/my.cnf
编辑修改 my.cnf 文件,只需要修改以下配置
# mysql 安装的基础目录 basedir = /usr # mysql 数据库文件目录(默认目录) datadir = /var/lib/mysql # 端口(可随意修改) port = 3306 # 大小写忽略(用于表名、字段) lower_case_table_names=1
附上我的 my.cnf 配置
# For advice on how to change settings please see # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html # *** DO NOT EDIT THIS FILE. It's a template which will be copied to the # *** default location during install, and will be replaced if you # *** upgrade to a newer version of MySQL. [mysqld] # Remove leading # and set to the amount of RAM for the most important data # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. # innodb_buffer_pool_size = 128M # Remove leading # to turn on a very important data integrity option: logging # changes to the binary log between backups. # log_bin # These are commonly set, remove the # and set as required. basedir = /usr datadir = /var/lib/mysql port = 3306 # server_id = ..... # socket = ..... # Remove leading # to set options mainly useful for reporting servers. # The server defaults are faster for transactions and fast SELECTs. # Adjust sizes as needed, experiment to find the optimal values. join_buffer_size = 128M sort_buffer_size = 16M # read_rnd_buffer_size = 2M lower_case_table_name = 1 thread_cache_size = 16 query_cache_size = 128M max_connections = 3000 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
5. 备注
以下为mysql 安装后的目录说明Directory | Contents of Directory |
---|---|
/usr/bin | Client programs and scripts |
/usr/sbin | The mysqld server |
/var/lib/mysql | Log files, databases |
/usr/share/info | Manual in Info format |
/usr/share/man | Unix manual pages |
/usr/include/mysql | Include (header) files |
/usr/lib/mysql | Libraries |
/usr/share/mysql | Miscellaneous support files, including error messages,character set files, sample configuration files, SQL for database installation |
/usr/share/sql-bench | Benchmarks |
6. 安装参考链接
http://blog.csdn.net/u010257584/article/details/51320542mysql my.cnf 说明
文章出自 http://blog.wordty.cn
相关文章推荐
- mysql 5.6.38 安装(redhat 6)
- MySQL 5.6.38在RedHat 6.5上通过RPM包安装
- Linux 下 (RedHat 9.0) JDK,Tomcat,MySQL的安装
- redhat安装mysql常见问题
- RedHat 9.0下用rpm包安装mysql的问题
- redhat 用yum安装的apache、mysql一般默认安装在哪个目录下?
- Linux RedHat 6.4 MySQL5.6源码包安装
- coentos6.5-minimal 安装mysql-5.6.38(rpm安装)
- Mysql 在linux下的安装以及卸载(redhat)
- Redhat 6 安装mysql 5.6.22遇到的问题总结
- linux(Ubuntu,redhat)中的Mysql 中的安装与使用
- centos7.4 安装mysql 5.6.38
- redhat 和 Ubuntu安装mysql以及找回root密码
- redhat6.4安装MySQL-server-5.5.28-1.linux2.6.x86_64.rpm
- RedHat 5.4服务器安装MySQL Server后的默认密码
- redhat7安装mysql-server(mysqld)
- redhat 下卸载安装mysql
- Redhat下 Apache, php, mysql的默认安装路径
- redhat 5.3 安装mysql详细步骤
- mysql redhat 64位 安装