RHEL6.4下MySQL安装方法及简单配置
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号

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

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











The main reasons for MySQL installation failure are: 1. Permission issues, you need to run as an administrator or use the sudo command; 2. Dependencies are missing, and you need to install relevant development packages; 3. Port conflicts, you need to close the program that occupies port 3306 or modify the configuration file; 4. The installation package is corrupt, you need to download and verify the integrity; 5. The environment variable is incorrectly configured, and the environment variables must be correctly configured according to the operating system. Solve these problems and carefully check each step to successfully install MySQL.

The article introduces the operation of MySQL database. First, you need to install a MySQL client, such as MySQLWorkbench or command line client. 1. Use the mysql-uroot-p command to connect to the server and log in with the root account password; 2. Use CREATEDATABASE to create a database, and USE select a database; 3. Use CREATETABLE to create a table, define fields and data types; 4. Use INSERTINTO to insert data, query data, update data by UPDATE, and delete data by DELETE. Only by mastering these steps, learning to deal with common problems and optimizing database performance can you use MySQL efficiently.

How to correct the error in MySQL database file path setting: 1. Stop MySQL service; 2. Strongly recommend backing up data; 3. Modify the datadir parameter in the configuration file to the correct path, and ensure that MySQL users have read and write permissions; 4. It is recommended to create a new data directory; 5. Start MySQL service; 6. Verify whether the database is running normally and data integrity. Be sure to operate with caution to avoid data loss.

MySQL installation failure is usually caused by the lack of dependencies. Solution: 1. Use system package manager (such as Linux apt, yum or dnf, Windows VisualC Redistributable) to install the missing dependency libraries, such as sudoaptinstalllibmysqlclient-dev; 2. Carefully check the error information and solve complex dependencies one by one; 3. Ensure that the package manager source is configured correctly and can access the network; 4. For Windows, download and install the necessary runtime libraries. Developing the habit of reading official documents and making good use of search engines can effectively solve problems.

Common reasons and solutions for MySQL installation failure: 1. Incorrect username or password, or the MySQL service is not started, you need to check the username and password and start the service; 2. Port conflicts, you need to change the MySQL listening port or close the program that occupies port 3306; 3. The dependency library is missing, you need to use the system package manager to install the necessary dependency library; 4. Insufficient permissions, you need to use sudo or administrator rights to run the installer; 5. Incorrect configuration file, you need to check the my.cnf configuration file to ensure the configuration is correct. Only by working steadily and carefully checking can MySQL be installed smoothly.

The solution to the MySQL repeated installation prompt is to completely remove the remaining traces: 1. Use the control panel to uninstall relevant programs; 2. Manually delete files and registry entries in the MySQL installation directory (backup before operation); 3. Stop and delete MySQL-related services in the system service; 4. Restart the computer. In addition, it is recommended to use professional uninstall tools, check environment variables, select official installation packages and clear installation paths to avoid this problem again.

Installing MySQL on macOS can be achieved through the following steps: 1. Install Homebrew, using the command /bin/bash-c"$(curl-fsSLhttps://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)". 2. Update Homebrew and use brewupdate. 3. Install MySQL and use brewinstallmysql. 4. Start MySQL service and use brewservicesstartmysql. After installation, you can use mysql-u

Installing MySQL on Linux can be done through the package manager. The specific steps are as follows: 1. On Ubuntu, use apt to update the package list and install the MySQL server; 2. On CentOS, use yum to install the MySQL community version and start the service. After installation, basic configuration needs to be performed, such as setting the root password and creating database and users.
