1.MySQL安装方法简介 1.rpm包yum安装 2.通用二进制包安装 3.源码编译安装 注意:实验所采用的系统平台为:RHEL6.4 2.rpm ins
首页 → 数据库技术
背景:
阅读新闻
RHEL6.4下MySQL安装方法及简单配置
[日期:2014-04-08] 来源:Linux社区 作者:xiongkun [字体:]
1.MySQL安装方法简介
1.rpm包yum安装
2.通用二进制包安装
3.源码编译安装
注意:实验所采用的系统平台为:RHEL6.4
2.rpm install
挂载光盘设置好系统的yum源,直接使用如下命令行:
# yum list | grep mysql-server
mysql-server.x86_64 5.1.66-2.el6_3 rhel6.4_x86_64
# yum install mysql mysql-server mysql-devel -y
# rpm -qi mysql-server 查看安装mysqlserver的相关信息
# rpm -ql mysql-server 查看安装mysql server产生的文件
# service mysql start 启动的过程会进行相关的mysql数据库的初始化
# chkconfig mysqld on
RHEL6.4中默认的版本为5.1.66,安装完成数据目录为:/var/lib/mysql(建议更改并使用lv)
如需要最新版本可以去官网下载
相关阅读:
CentOS下MySQL安装配置过程详解
MySQL安装(rpm)和启动配置
MySQL安装脚本只需执行即可安装
Linux下MySQL安装详解
CentOS上MySQL安装配置操作说明
3.通用二进制包格式安装(以MySQL5.5.33为例)
3.1.准备逻辑卷存放数据(挂载建议使用noatime不更新访问时间)
3.2.简单安装
默认:/usr/local/mysql/data修改为:/mydata/data
注意:其中vim /etc/my.cnf内容如下:
[mysqld]
thread_concurrency = 4 #CPU物理核心的两倍
datadir = /mydata/data #修改数据文件的目录
3.3.启动服务并查看监控端口
如果忘记服务密码,可以修改该脚本start选项参数添加--skip-grant --skip-networking 跳过验证。
3.4.执行如下相关操作进行环境设置
# vim /etc/profile.d/mysqld.sh 修改PATH路径
export PATH=/usr/local/mysql/bin:$PATH
# source /etc/profile 重新加载
# ln -sv /usr/local/mysql/include /usr/include/mysql 链接头文件
# ls /usr/include/mysql/
# vim /etc/ld.so.conf.d/mysql.conf 添加库文件
/usr/local/mysql/lib
# ldconfig -v | grep mysql 验证动态链接库
/usr/local/mysql/lib:
libmysqlclient.so.18 -> libmysqlclient_r.so.18.0.0
/usr/lib64/mysql:
libmysqlclient.so.16 -> libmysqlclient.so.16.0.0
libmysqlclient_r.so.16 -> libmysqlclient_r.so.16.0.0
# vim /etc/man.config 设置man文档
MANPATH /usr/local/mysql/man
3.5.登录数据库删除相关的匿名用户并为相关应用程序提供专用的授权帐号
注意:mysql授权用户的权限可以转移
MySQL运行原理与基础架构
Oracle异常处理—ORA-12514:监听程序当前无法识别连接描述符中请求的服务
相关资讯 MySQL安装
图片资讯
本文评论 查看全部评论 (0)
评论声明
最新资讯
本周热门
Linux公社简介 - 广告服务 - 网站地图 - 帮助信息 - 联系我们
本站(LinuxIDC)所刊载文章不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。
Copyright © 2006-2014 Linux公社 All rights reserved 浙ICP备06018118号

Mastering the method of adding MySQL users is crucial for database administrators and developers because it ensures the security and access control of the database. 1) Create a new user using the CREATEUSER command, 2) Assign permissions through the GRANT command, 3) Use FLUSHPRIVILEGES to ensure permissions take effect, 4) Regularly audit and clean user accounts to maintain performance and security.

ChooseCHARforfixed-lengthdata,VARCHARforvariable-lengthdata,andTEXTforlargetextfields.1)CHARisefficientforconsistent-lengthdatalikecodes.2)VARCHARsuitsvariable-lengthdatalikenames,balancingflexibilityandperformance.3)TEXTisidealforlargetextslikeartic

Best practices for handling string data types and indexes in MySQL include: 1) Selecting the appropriate string type, such as CHAR for fixed length, VARCHAR for variable length, and TEXT for large text; 2) Be cautious in indexing, avoid over-indexing, and create indexes for common queries; 3) Use prefix indexes and full-text indexes to optimize long string searches; 4) Regularly monitor and optimize indexes to keep indexes small and efficient. Through these methods, we can balance read and write performance and improve database efficiency.

ToaddauserremotelytoMySQL,followthesesteps:1)ConnecttoMySQLasroot,2)Createanewuserwithremoteaccess,3)Grantnecessaryprivileges,and4)Flushprivileges.BecautiousofsecurityrisksbylimitingprivilegesandaccesstospecificIPs,ensuringstrongpasswords,andmonitori

TostorestringsefficientlyinMySQL,choosetherightdatatypebasedonyourneeds:1)UseCHARforfixed-lengthstringslikecountrycodes.2)UseVARCHARforvariable-lengthstringslikenames.3)UseTEXTforlong-formtextcontent.4)UseBLOBforbinarydatalikeimages.Considerstorageov

When selecting MySQL's BLOB and TEXT data types, BLOB is suitable for storing binary data, and TEXT is suitable for storing text data. 1) BLOB is suitable for binary data such as pictures and audio, 2) TEXT is suitable for text data such as articles and comments. When choosing, data properties and performance optimization must be considered.

No,youshouldnotusetherootuserinMySQLforyourproduct.Instead,createspecificuserswithlimitedprivilegestoenhancesecurityandperformance:1)Createanewuserwithastrongpassword,2)Grantonlynecessarypermissionstothisuser,3)Regularlyreviewandupdateuserpermissions

MySQLstringdatatypesshouldbechosenbasedondatacharacteristicsandusecases:1)UseCHARforfixed-lengthstringslikecountrycodes.2)UseVARCHARforvariable-lengthstringslikenames.3)UseBINARYorVARBINARYforbinarydatalikecryptographickeys.4)UseBLOBorTEXTforlargeuns


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.
