CentOS6.5上安装MySQL

1.查看操作系统的相关信息

2.查看系统上所有MySQL的rpm包并删除

  [[email protected] ~]# rpm -qa | grep -i mysql

  [[email protected] ~]# yum -y remove mysql-libs-5.1*

3.下载MySQL-5.6.21所需的rpm包

  [[email protected] tools]# wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-server-5.6.21-1.rhel5.x86_64.rpm 
  [[email protected] tools]# wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-devel-5.6.21-1.rhel5.x86_64.rpm 
  [[email protected] tools]# wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-client-5.6.21-1.rhel5.x86_64.rpm

4.安装三个rpm包

  [[email protected] tools]# rpm -ivh MySQL-server-5.6.21-1.rhel5.x86_64.rpm

  如果运行的过程是这样,就恭喜你失败了,因为之前安装的MySQL没有删除干净,会导致后面出现各种乱七八糟的错。

  Preparing...                    ########################################### [100%] 
      1:MySQL-client          ########################################### [100%]

  解决方法:查看残留的目录并删除相关的文件

    whereis mysql

    rm –rf /usr/lib64/mysql

    rm –rf /usr/my.cnf
    rm -rf /root/.mysql_sercret

    rm -rf /var/lib/mysql

  正确的过程:

     Preparing...                ########################################### [100%]

    1:MySQL-server           ########################################### [100%]

2017-09-25 13:46:09 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2017-09-25 13:46:09 2188 [Note] InnoDB: Using atomics to ref count buffer pool pages

2017-09-25 13:46:09 2188 [Note] InnoDB: The InnoDB memory heap is disabled

2017-09-25 13:46:09 2188 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2017-09-25 13:46:09 2188 [Note] InnoDB: Memory barrier is not used

2017-09-25 13:46:09 2188 [Note] InnoDB: Compressed tables use zlib 1.2.3

2017-09-25 13:46:09 2188 [Note] InnoDB: Using Linux native AIO

2017-09-25 13:46:09 2188 [Note] InnoDB: Using CPU crc32 instructions

2017-09-25 13:46:09 2188 [Note] InnoDB: Initializing buffer pool, size = 128.0M

2017-09-25 13:46:09 2188 [Note] InnoDB: Completed initialization of buffer pool

2017-09-25 13:46:09 2188 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!

2017-09-25 13:46:09 2188 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB

2017-09-25 13:46:09 2188 [Note] InnoDB: Database physically writes the file full: wait...

2017-09-25 13:46:09 2188 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB

2017-09-25 13:46:09 2188 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB

2017-09-25 13:46:10 2188 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0

2017-09-25 13:46:10 2188 [Warning] InnoDB: New log files created, LSN=45781

2017-09-25 13:46:10 2188 [Note] InnoDB: Doublewrite buffer not found: creating new

2017-09-25 13:46:10 2188 [Note] InnoDB: Doublewrite buffer created

2017-09-25 13:46:10 2188 [Note] InnoDB: 128 rollback segment(s) are active.

2017-09-25 13:46:10 2188 [Warning] InnoDB: Creating foreign key constraint system tables.

2017-09-25 13:46:10 2188 [Note] InnoDB: Foreign key constraint system tables created

2017-09-25 13:46:10 2188 [Note] InnoDB: Creating tablespace and datafile system tables.

2017-09-25 13:46:10 2188 [Note] InnoDB: Tablespace and datafile system tables created.

2017-09-25 13:46:10 2188 [Note] InnoDB: Waiting for purge to start

2017-09-25 13:46:10 2188 [Note] InnoDB: 5.6.21 started; log sequence number 0

A random root password has been set. You will find it in ‘/root/.mysql_secret‘.

2017-09-25 13:46:14 2188 [Note] Binlog end

2017-09-25 13:46:14 2188 [Note] InnoDB: FTS optimize thread exiting.

2017-09-25 13:46:14 2188 [Note] InnoDB: Starting shutdown...

2017-09-25 13:46:15 2188 [Note] InnoDB: Shutdown completed; log sequence number 1625977

2017-09-25 13:46:15 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2017-09-25 13:46:15 2211 [Note] InnoDB: Using atomics to ref count buffer pool pages

2017-09-25 13:46:15 2211 [Note] InnoDB: The InnoDB memory heap is disabled

2017-09-25 13:46:15 2211 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2017-09-25 13:46:15 2211 [Note] InnoDB: Memory barrier is not used

2017-09-25 13:46:15 2211 [Note] InnoDB: Compressed tables use zlib 1.2.3

2017-09-25 13:46:15 2211 [Note] InnoDB: Using Linux native AIO

2017-09-25 13:46:15 2211 [Note] InnoDB: Using CPU crc32 instructions

2017-09-25 13:46:15 2211 [Note] InnoDB: Initializing buffer pool, size = 128.0M

2017-09-25 13:46:15 2211 [Note] InnoDB: Completed initialization of buffer pool

2017-09-25 13:46:15 2211 [Note] InnoDB: Highest supported file format is Barracuda.

2017-09-25 13:46:15 2211 [Note] InnoDB: 128 rollback segment(s) are active.

2017-09-25 13:46:15 2211 [Note] InnoDB: Waiting for purge to start

2017-09-25 13:46:15 2211 [Note] InnoDB: 5.6.21 started; log sequence number 1625977

2017-09-25 13:46:15 2211 [Note] Binlog end

2017-09-25 13:46:15 2211 [Note] InnoDB: FTS optimize thread exiting.

2017-09-25 13:46:15 2211 [Note] InnoDB: Starting shutdown...

2017-09-25 13:46:17 2211 [Note] InnoDB: Shutdown completed; log sequence number 1625987

A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !

You will find that password in ‘/root/.mysql_secret‘.

You must change that password on your first connect,

no other statement but ‘SET PASSWORD‘ will be accepted.

See the manual for the semantics of the ‘password expired‘ flag.

Also, the account for the anonymous user has been removed.

In addition, you can run:

/usr/bin/mysql_secure_installation

which will also give you the option of removing the test database.

This is strongly recommended for production servers.

See the manual for more instructions.

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as /usr/my.cnf and

will be used by default by the server when you start it.

You may edit this file to change server settings

WARNING: Default config file /etc/my.cnf exists on the system

This file will be read by default by the MySQL server

If you do not want to use this, either remove it, or use the

--defaults-file argument to mysqld_safe when starting the server

[[email protected] tools]# rpm -ivh MySQL-client-5.6.21-1.rhel5.x86_64.rpm

  Preparing...                 ########################################### [100%]

   1:MySQL-client           ########################################### [100%]

[[email protected] tools]# rpm -ivh MySQL-devel-5.6.21-1.rhel5.x86_64.rpm

  Preparing...                    ########################################### [100%]

  1:MySQL-devel           ########################################### [100%]

5.修改配置文件位置

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

  [[email protected] tools]#cp -a /usr/share/mysql/mysql.server /etc/init.d/mysqld

6.初始化MySQL

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

7.启动MySQL

  [[email protected] mysql]# /etc/init.d/mysql restart

安装的时候参考了http://www.linuxidc.com/Linux/2015-04/116003.htm

时间: 2025-01-10 17:29:57

CentOS6.5上安装MySQL的相关文章

在linux(CentOS-6.7_x86_64)上安装mysql成功记录

查看linux服务器的yum源设置: [root@hadoop03 yum.repos.d]# cd /etc/yum.repos.d [[email protected] yum.repos.d]# ll total 4 -rw-r--r--. 1 root root 564 Dec 27 11:27 CentOS-Media.repo [root@hadoop03 yum.repos.d]# vi CentOS-Media.repo # CentOS-Media.repo # # This

centos6.5上安装mysql过程

1.查看已安装的版本 rpm -qa|grep -i mysql 2.删除已有mysql yum remove mysql-libs  移除已经安装的mysql 命令:rm -fr /usr/lib/mysql   rm -fr /usr/include/mysql  删除老版本mysql的开发头文件和库 rm -fr /var/lib/mysql   删除数据文件 rm -f /etc/my.cnf   删除配置文件 3.开始mysql 使用rz命令上传两个安装包 MySQL-client-5

centos6.5上安装5.7版本的mysql

centos6.5上安装5.7版本的mysql https://www.cnblogs.com/lzj0218/p/5724446.html 设置root可以在本机以外的机器访问 mysql -uroot -ppassword > use mysql> select host , user from user;> update user set host = '%' where user = 'root';> select host , user from user; 搜权 myu

LAMP+Centos6.5上安装zabbix

系统版本:centos6.5 内核版本:2.6.32-358.el6.x86_64 yum安装LAMP环境: yum install -y gcc gcc-c++httpd httpd-devel mysql msql-server mysql-devel php php-mysql php-common php-gdphp-mbstring php-mcrtpt php-devel php-xml php-bcmath libcurl-develnet-snmp-devel 2.  添加用户及

阿里云服务器上安装mysql的心路历程(博友们进来看看哦)

在阿里云花了100买了一台云服务器,配置如下: CPU: 1核 内存: 512MB 数据盘: 0G 带宽: 1Mbps 阿里云服务器安装mysql搞得我想吐血,搞了一个多星期,现在才搞好,而且,还有许多问号存在我的脑海里.... 说说我在阿里云服务器上安装mysql的心路历程吧,刚开始安装好java8和tomcat8,安装非常的顺利,但是我接下来要安装mysql了,在网上看到一篇帖子(是rpm包安装的,也在本机上的centos6.5安装过没有问题),所以我就按照这个安装mysql,可是失败了,报

centos6.5下安装mysql 5.6

1.使用yum命令安装mysql [html] view plaincopy [[email protected] ~]#  yum -y install mysql-server 2.设置开机启动 [html] view plaincopy [[email protected] ~]#  chkconfig mysqld on 3.启动MySQL服务 [html] view plaincopy [[email protected] ~]#  service mysqld start 4.设置M

建站笔记1:centos6.5下安装mysql

最近买了个域名,想要玩玩自己建网站:接下来遇到的问题都会一次记录下来,以备自己以后复习查看: 首先建站方案选择: wordPress +centos6.5 +mysql; 服务器买的:搬瓦工最低配置,其实主要用来使用vpn,( 你懂的,感兴趣的可以翻看我以前的博客). 地址:https://bandwagonhost.com  wordpress 下载地址:https://cn.wordpress.org 域名是百度开放云买的,推荐,很优惠啊! 第一个问题:centos6.5下安装mysql: 

Ubuntu上安装MySql过程,以及遇到的一些问题

今天在Ubuntu服务器上安装MySql的时候遇到了一些问题,记录下来,以防以后忘记. 安装环境:Ubuntu14.04 安装命令: //安装Mysal服务端//会提示输入root密码 sudo apt-get install mysql-server //安装Mysql客户端 sudo apt-get install mysql-client sudo apt-get install libmysqlclient-dev 错误一描述: 远程连接MySql的时候出现错误:错误码2203 Can`

在Linux(CentOS)上安装MySql详细记录

前记:  毕业两年了,前两天换了份工作,由以前的传统行业跳到了互联网行业.之前的公司一直在用WinServer2003+Tomcat+SqlServer/Oracle这套部署环境.对于Linux+Tomcat(或其他容器)+Mysql这套之前没用用过.所以利用这周末的我在阿里云上49元搞了个linux(centos 64位)的服务器. 刚开始先装了JDK1.6,安装了Tomcat6.0.这过程中没有遇到太大的问题, 小问题也google一下就解决了.而周六晚上开始安装Mysql,于是到今天下午为