centos6.4 rpm mysql安装步骤

1,检查MySQL及相关RPM包,是否安装,如果有安装,则移除(rpm –e 名称)

[[email protected] ~]# rpm -qa | grep -i mysql mysql-libs-5.1.66-2.el6_3.x86_64 [[email protected] ~]# yum -y remove mysql-libs*

2,删除掉系统中原有的数据,不然可以导致错误,我实际安装过程中试了几个小时,如果还有错,请参考

点击打开链接

mv /var/lib/mysql /var/lib/mysql_old
[Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

[Note] Plugin ‘FEDERATED‘ is disabled.

[Note] InnoDB: The InnoDB memory heap is disabled

[Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

[Note] InnoDB: Compressed tables use zlib 1.2.3

[Note] InnoDB: CPU does not support crc32 instructions

[Note] InnoDB: Using Linux native AIO

[Note] InnoDB: Initializing buffer pool, size = 128.0M

[Note] InnoDB: Completed initialization of buffer pool

[ERROR] InnoDB: auto-extending data file ./ibdata1 is of a different size 640 pages (rounded down to MB) than specified in the .cnf file: initial 768 pages, max 0 (relevant if non-zero) pages!

[ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!

[ERROR] Plugin ‘InnoDB‘ init function returned error.

[ERROR] Plugin ‘InnoDB‘ registration as a STORAGE ENGINE failed.

[ERROR] Unknown/unsupported storage engine: InnoDB

[ERROR] Aborting

[Note] Binlog end

[Note] Shutting down plugin ‘partition‘

[Note] Shutting down plugin ‘BLACKHOLE‘

[Note] Shutting down plugin ‘PERFORMANCE_SCHEMA‘

[Note] Shutting down plugin ‘ARCHIVE‘

[Note] Shutting down plugin ‘INNODB_SYS_DATAFILES‘

[Note] Shutting down plugin ‘INNODB_SYS_TABLESPACES‘

[Note] Shutting down plugin ‘INNODB_SYS_FOREIGN_COLS‘

[Note] Shutting down plugin ‘INNODB_SYS_FOREIGN‘

[Note] Shutting down plugin ‘INNODB_SYS_FIELDS‘

[Note] Shutting down plugin ‘INNODB_SYS_COLUMNS‘

[Note] Shutting down plugin ‘INNODB_SYS_INDEXES‘

[Note] Shutting down plugin ‘INNODB_SYS_TABLESTATS‘

[Note] Shutting down plugin ‘INNODB_SYS_TABLES‘

[Note] Shutting down plugin ‘INNODB_FT_INDEX_TABLE‘

[Note] Shutting down plugin ‘INNODB_FT_INDEX_CACHE‘

[Note] Shutting down plugin ‘INNODB_FT_CONFIG‘

[Note] Shutting down plugin ‘INNODB_FT_BEING_DELETED‘

[Note] Shutting down plugin ‘INNODB_FT_DELETED‘

[Note] Shutting down plugin ‘INNODB_FT_INSERTED‘

[Note] Shutting down plugin ‘INNODB_FT_DEFAULT_STOPWORD‘

[Note] Shutting down plugin ‘INNODB_METRICS‘

[Note] Shutting down plugin ‘INNODB_BUFFER_POOL_STATS‘

[Note] Shutting down plugin ‘INNODB_BUFFER_PAGE_LRU‘

[Note] Shutting down plugin ‘INNODB_BUFFER_PAGE‘

[Note] Shutting down plugin ‘INNODB_CMP_PER_INDEX_RESET‘

[Note] Shutting down plugin ‘INNODB_CMP_PER_INDEX‘

[Note] Shutting down plugin ‘INNODB_CMPMEM_RESET‘

[Note] Shutting down plugin ‘INNODB_CMPMEM‘

[Note] Shutting down plugin ‘INNODB_CMP_RESET‘

[Note] Shutting down plugin ‘INNODB_CMP‘

[Note] Shutting down plugin ‘INNODB_LOCK_WAITS‘

[Note] Shutting down plugin ‘INNODB_LOCKS‘

[Note] Shutting down plugin ‘INNODB_TRX‘

[Note] Shutting down plugin ‘MRG_MYISAM‘

[Note] Shutting down plugin ‘MEMORY‘

[Note] Shutting down plugin ‘CSV‘

[Note] Shutting down plugin ‘MyISAM‘

[Note] Shutting down plugin ‘sha256_password‘

[Note] Shutting down plugin ‘mysql_old_password‘

[Note] Shutting down plugin ‘mysql_native_password‘

[Note] Shutting down plugin ‘binlog‘

[Note] /usr/sbin/mysqld: Shutdown complete

 mysqld_safe mysqld from pid file /var/lib/mysql/mysql.pid ended

2,下载Linux对应的RPM包,如:CentOS6.4_32对应的RPM包,如下:

-rwxr--r--. 1 nobody nobody  22838580 Mar 17 17:39 MySQL-client-5.6.17-1.linux_glibc2.5.i386.rpm

-rwxr--r--. 1 nobody nobody   4135464 Mar 17 17:40 MySQL-devel-5.6.17-1.linux_glibc2.5.i386.rpm

-rwxr--r--. 1 nobody nobody 109826437 Mar 17 17:40 MySQL-embedded-5.6.17-1.linux_glibc2.5.i386.rpm

-rwxr--r--. 1 nobody nobody  87469456 Mar 17 17:41 MySQL-server-5.6.17-1.linux_glibc2.5.i386.rpm

-rwxr--r--. 1 nobody nobody   2362688 Mar 17 17:41 MySQL-shared-5.6.17-1.linux_glibc2.5.i386.rpm

-rwxr--r--. 1 nobody nobody   5294221 Mar 17 17:41 MySQL-shared-compat-5.6.17-1.linux_glibc2.5.i386.rpm

-rwxr--r--. 1 nobody nobody  74163863 Mar 17 17:41 MySQL-test-5.6.17-1.linux_glibc2.5.i386.rpm

3, 安装mysl

[[email protected] rpm]# rpm -ivh MySQL-server-5.6.15-1.el6.x86_64.rpm

[[email protected] rpm]# rpm -ivh MySQL-devel-5.6.15-1.el6.x86_64.rpm

[[email protected] rpm]# rpm -ivh MySQL-client-5.6.15-1.el6.x86_64.rpm

#修改配置文件位置

[[email protected] rpm]# cp /usr/share/mysql/my-default.cnf /etc/my.cnf

4,初使化MYSQL及配置密码

[[email protected] rpm]# /usr/bin/mysql_install_db

[[email protected] rpm]# service mysql start

[[email protected] rpm]# cat /root/.mysql_secret  #查看root账号密码

# The random password set for the root user at Wed Dec 11 23:32:50 2013 (local time): qKTaFZnl

[[email protected] ~]# mysql -uroot –pqKTaFZnl

mysql> SET PASSWORD = PASSWORD(‘123456‘);    #设置密码为123456

mysql> exit

[[email protected] ~]# mysql -uroot -p123456

5,允许远程登录

mysql> use mysql;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

Database changed

mysql> select host,user,password from user;

+-----------------------+------+-------------------------------------------+

| host                  | user | password                                  |

+-----------------------+------+-------------------------------------------+

| localhost             | root | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |

| localhost.localdomain | root | *A4B8196FF869F64E0119B231785E5946EDBA5E26 |

| 127.0.0.1             | root | *A4B8196FF869F64E0119B231785E5946EDBA5E26 |

| ::1                   | root | *A4B8196FF869F64E0119B231785E5946EDBA5E26 |

+-----------------------+------+-------------------------------------------+

4 rows in set (0.00 sec)

mysql> update user set password=password(‘root‘) where user=‘root‘;

Query OK, 3 rows affected (0.01 sec)
Rows matched: 4  Changed: 3  Warnings: 0
mysql> update user set host=‘%‘ where user=‘root‘ and host=‘localhost‘;
Query OK, 1 row affected (0.04 sec)
Rows matched: 1  Changed: 1  Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

6,设置开机自启动

[[email protected] ~]# chkconfig mysql on
[[email protected] ~]# chkconfig --list | grep mysql
mysql           0:off   1:off   2:on    3:on    4:on    5:on    6:off

7,查看mysql配置文件位置

mysqld --verbose --help | grep -A 1 ‘Default options‘

8,MYSQL默认安装位置

/var/lib/mysql/               #数据库目录
/usr/share/mysql              #配置文件目录
/usr/bin                     #相关命令目录
/etc/init.d/mysql              #启动脚本

9,配置字符集

修改字符集和数据存储路径

配置/etc/my.cnf文件,修改数据存放路径、mysql.sock路径以及默认编码utf-8.

[client]  
    password        = 123456  
    port            = 3306  
    default-character-set=utf8  
    [mysqld]  
    port            = 3306  
    character_set_server=utf8  
    character_set_client=utf8  
    collation-server=utf8_general_ci  
    #(注意linux下mysql安装完后是默认:表名区分大小写,列名不区分大小写; 0:区分大小写,1:不区分大小写)  
    lower_case_table_names=1  
    #(设置最大连接数,默认为 151,MySQL服务器允许的最大连接数16384; )  
    max_connections=1000  
    [mysql]  
    default-character-set = utf8

查看字符集

show variables like ‘%collation%‘;

show variables like ‘%char%‘;

时间: 2024-08-28 02:04:14

centos6.4 rpm mysql安装步骤的相关文章

日记(2014-07-09) centos6.5 rpm方式安装gcc

由于实验室rpm包都被过滤掉,导致centos里面的yum无法下载安装软件.使用make编译各种软件源码发现没有gcc,g++.只好采用离线方式进行安装.话说yum无法下载rpm包,在下面的地址居然可以下载rpm压缩包.我这菜鸟没弄明白为什么. 在网上搜索资料安装成功,gcc和g++的rpm包下载地址http://fr2.rpmfind.net/linux/rpm2html/search.php?query=gcc-c%2B%2B&submit=Search+...&system=&

Python、Django和Mysql安装步骤

很多初学者都问Python和Django怎么安装,这里我们就简单地介绍一下这两个软件在Windows 2003下的安装步骤. 一.下载并安装Python Python 官方下载地址:http://www.python.org/ftp/python/ 我们这里选择的是 Python 2.7.2 .虽然目前最新版是Python 3.2.2, 但是Django目前还不支持 Python 3.2.2. 安装步骤很简单,双击安装包开始安装,这里我们安装到 D:\Python,如图1, 图1 单击“Next

MySQL安装步骤

1.下载MySQL 在官网下载MySQL https://www.mysql.com/downloads/,注意:下载MySQL Community Server版本,下载压缩版 2.解压缩 在本地解压缩MySQL,并且放到对应的位置.笔者放在D:\Program Files 3.环境变量 在桌面上对"我的电脑"点击右键,选择"属性"--"高级系统设置","高级"页签,选择"环境变量".点击"新建

Linux MySql安装步骤

本文将以MySQL 5.5.47为例,以CentOS 6.5为平台,讲述MySQL数据库的安装和设置. 源码包方式安装 1.新建MySql用户和用户组 groupadd mysql useradd -r -g mysql -M mysql yum install boost-devel tar -zxvf mysql-5.5.47.tar.gz yum install cmake yum install gc-devel yum install git yum install gcc-c++ y

mysql 5.6 rpm 包安装步骤需要注意的地方

1. [[email protected] /]# service mysql restart  ERROR! MySQL server PID file could not be found! Starting MySQL ERROR! Couldn't find MySQL server (/usr/share/mysql/bin/mysqld_safe) 解决方法: [[email protected] /]# locate mysql.pid /var/lib/mysql/mysql.p

Centos6系统RPM包安装Zabbix3.0

1.安装MySQL 1 2 #rpm -ivh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm #yum install -y mysql-server mysql-devel 1 2 3 4 5 6 7 8 service mysqld start   mysql_secure_installation    #MySQL安全配置向导 Enter current password for root (enter

超详细Centos6.5文本模式安装步骤

对于刚接触Linux的用户来说,安装系统和配置网卡的过程也可能要用很长的时间,Centos6.5的安装方式有二种,图形模式和文本模式.文本模式从6开始就不支持自定义分区了(新手练习时默认分区足够用),如果需要自定义分区要使用图形模式安装.大家在学习Linux时,不需要一开始就在物理机上安装,下面就使用VMware Workstation虚拟机软件演示一下文本模式安装. 演示环境所需要的软件: 虚拟机版本:VMware Workstation12 Linux版本:CentOS-6.5-x86_64

免安装版MySQL安装步骤

http://downloads.mysql.com/archives/community/ 1:添加环境变量把MySQL解压后的bin目录添加到path环境变量中 2:修改或者添加my-default.ini[mysqld]basedir = D:\mysql-5.6.24datadir = D:\mysql-5.6.24\data 3:进入bin目录安装mysql D:\mysql-5.5.46\bin>mysqld -installService successfully installe

解压版mysql安装步骤

第一步:解压mysql,例如解压后的目录在C:\Program Files\mysql-5.6.36-winx64 第二步:配置mysql环境变量,类似配置java的环境变量 计算机右键===>属性===>高级系统设置===>高级===>环境变量 新建系统变量: 变量名:MYSQL_HOME 变量值:C:\Program Files\mysql-5.6.36-winx64 编辑系统变量Path,追加%MYSQL_HOME%\bin; 第三步:进入C:\Program Files\m