在linux安装mysql是一个困难的事情,yum安装一般是安装的mysql5.1,现在经过自己不懈努力终于能用yum安装mysql5.5了。下面通过两种方法给大家介绍CentOS 6.5下yum安装 MySQL-5.5全过程,一起学习吧。
方法一:
具体方法和步骤如下所示:
1.第一步就是看linu是否安装了mysql,经过rpm -qa|grep mysql查看到centos下安装了mysql5.1,那就开始卸载咯
2.接下来就是卸载mysql5.1了,命令:rpm -e mysql-libs --nodeps
3.yum中之后mysql5.1,安装还是5.1,现在就要去增加一个新的repo
rpm -Uvh http://mirror.steadfast.net/epel/6/i386/epel-release-6-8.noarch.rpm
4.一共需要增加两个repo,现在增加另一个
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
5.现在查看一些是否增加成功了,yum --enablerepo=remi,remi-test list mysql mysql-server
看到下面这些就是安装成功了。
6.接下来就是安装mysql5.5了
yum --enablerepo=remi,remi-test install mysql mysql-server
7.出现这个东西的时候一定要选择y。不然神都救不了你,就要重新安装了。
8.看到下面这个图片证明你的mysql安装成功了。
9.接下来需要启动一下mysql
/etc/init.d/mysqld start
10.下面这条命令设置开机自启动,省的我们每次开机就去启动一下mysql了。
chkconfig --levels 345 mysqld on
11.要启用MySQL 安全设置请输入以下命令
/usr/bin/mysql_secure_installation
12.到这里就要验证一下mysql是否安装成功了。如果输入看到以下界面的话,那么你就安装成功了。犒劳一下自己吧。
注意事项
所有的命令一定要注意大小写
空格也不要乱加。
一定要在root用户下进行以上安装
方法二:
在linux安装mysql是一个困难的事情,yum安装一般是安装的mysql5.1,现在经过自己不懈努力终于能用yum安装mysql5.5了、
1.安装mysql-5.5的yum源
rpm -ivh http://repo.mysql.com/yum/mysql-5.5-community/el/6/x86_64/mysql-community-release-el6-5.noarch.rpm
2.修改安装好的yum源
编辑 /etc/yum.repos.d/mysql-community.repo文件,将5.5的enabled改为1,5.6的enabled改为0
# Enable to use MySQL 5.5 [mysql55-community] name=MySQL 5.5 Community Server baseurl=http://repo.mysql.com/yum/mysql-5.5-community/el/6/$basearch/ enabled=1 gpgcheck=1 gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql # Enable to use MySQL 5.6 [mysql56-community] name=MySQL 5.6 Community Server baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
3.安装mysql-5.5
yum install mysql-community-client mysql-community-devel mysql-community-server php-mysql
4.调整配置
编辑 /etc/my.cnf 文件
innodb_file_per_table=1 设置InnoDB为独立表空间模式,每个数据库的每个表都会生成一个数据目录
innodb_buffer_pool_size= 默认值:128M,设置为操作系统内存的70%-80%最佳

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

Article discusses strategies for handling large datasets in MySQL, including partitioning, sharding, indexing, and query optimization.

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

The article discusses dropping tables in MySQL using the DROP TABLE statement, emphasizing precautions and risks. It highlights that the action is irreversible without backups, detailing recovery methods and potential production environment hazards.

Article discusses using foreign keys to represent relationships in databases, focusing on best practices, data integrity, and common pitfalls to avoid.

The article discusses creating indexes on JSON columns in various databases like PostgreSQL, MySQL, and MongoDB to enhance query performance. It explains the syntax and benefits of indexing specific JSON paths, and lists supported database systems.

Article discusses securing MySQL against SQL injection and brute-force attacks using prepared statements, input validation, and strong password policies.(159 characters)


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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

WebStorm Mac version
Useful JavaScript development tools

Dreamweaver CS6
Visual web development tools

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

SublimeText3 Chinese version
Chinese version, very easy to use
