zoukankan      html  css  js  c++  java
  • CentOS 6.8下安装MySQL 5.6.33

    此处操作,包含MySQL的客户端及服务端。

    MySQL下载地址: http://dev.mysql.com/downloads/mysql/5.6.html

    1 MySQL-5.6.33-1.linux_glibc2.5.x86_64.rpm-bundle.tar

    下载到本地,将其解压,得到如下文件:

    1 -rw-r--r--. 1 7155 31415  23514633 Aug 29 18:11 MySQL-client-5.6.33-1.linux_glibc2.5.x86_64.rpm
    2 -rw-r--r--. 1 7155 31415   4593511 Aug 29 18:11 MySQL-devel-5.6.33-1.linux_glibc2.5.x86_64.rpm
    3 -rw-r--r--. 1 7155 31415 117878328 Aug 29 18:11 MySQL-embedded-5.6.33-1.linux_glibc2.5.x86_64.rpm
    4 -rw-r--r--. 1 7155 31415  89757099 Aug 29 18:12 MySQL-server-5.6.33-1.linux_glibc2.5.x86_64.rpm
    5 -rw-r--r--. 1 7155 31415   2424746 Aug 29 18:12 MySQL-shared-5.6.33-1.linux_glibc2.5.x86_64.rpm
    6 -rw-r--r--. 1 7155 31415   5181146 Aug 29 18:12 MySQL-shared-compat-5.6.33-1.linux_glibc2.5.x86_64.rpm
    7 -rw-r--r--. 1 7155 31415  75564628 Aug 29 18:13 MySQL-test-5.6.33-1.linux_glibc2.5.x86_64.rpm

    其中,用到的部分,只有client以及server两个文件。

    在安装之前,最好要执行一下检测当前系统是否安装有其他版本的MySQL,否则安装过程中会出现安装包中的插件和已经安装的插件有冲突,something confilcts with exiting 巴拉巴拉。。。。。

    1 rpm -qa | grep -i mysql

    rpm安装程序很简单,就不多说.
    安装后的程序,客户端mysql在/usr/bin下面,服务端在/usr/sbin/下面。mysql的安装脚本会被copy到/etc/init.d/目录下。最简单的事情,什么都不修改,用默认的配置,则mysql的配置项目datadir是在

    此处操作,包含MySQL的客户端及服务端。

    MySQL下载地址: http://dev.mysql.com/downloads/mysql/5.6.html

    1 MySQL-5.6.33-1.linux_glibc2.5.x86_64.rpm-bundle.tar

    下载到本地,将其解压,得到如下文件:

    1 -rw-r--r--. 1 7155 31415  23514633 Aug 29 18:11 MySQL-client-5.6.33-1.linux_glibc2.5.x86_64.rpm
    2 -rw-r--r--. 1 7155 31415   4593511 Aug 29 18:11 MySQL-devel-5.6.33-1.linux_glibc2.5.x86_64.rpm
    3 -rw-r--r--. 1 7155 31415 117878328 Aug 29 18:11 MySQL-embedded-5.6.33-1.linux_glibc2.5.x86_64.rpm
    4 -rw-r--r--. 1 7155 31415  89757099 Aug 29 18:12 MySQL-server-5.6.33-1.linux_glibc2.5.x86_64.rpm
    5 -rw-r--r--. 1 7155 31415   2424746 Aug 29 18:12 MySQL-shared-5.6.33-1.linux_glibc2.5.x86_64.rpm
    6 -rw-r--r--. 1 7155 31415   5181146 Aug 29 18:12 MySQL-shared-compat-5.6.33-1.linux_glibc2.5.x86_64.rpm
    7 -rw-r--r--. 1 7155 31415  75564628 Aug 29 18:13 MySQL-test-5.6.33-1.linux_glibc2.5.x86_64.rpm

    其中,用到的部分,只有client以及server两个文件。

    在安装之前,最好要执行一下检测当前系统是否安装有其他版本的MySQL,否则安装过程中会出现安装包中的插件和已经安装的插件有冲突,something confilcts with exiting 巴拉巴拉。。。。。

    1 rpm -qa | grep -i mysql

    rpm安装程序很简单,就不多说.
    安装后的程序,客户端mysql在/usr/bin下面,服务端在/usr/sbin/下面。mysql的安装脚本会被copy到/etc/init.d/目录下。最简单的事情,什么都不修改,用默认的配置,则mysql的配置项目basedir是在/var/lib/mysql下面。

    现在,需要注意了,MySQL的datadir需要设置mysql的用户owner以及group。

    1 chown -R mysql:mysql /var/lib/mysql                #这一步是绝对的重点,不要忘记,若启动mysql daemon出错,需要检查下权限问题。

    否则,启动mysqld是会失败的。。。。

    1 [root@CloudGame bin]# service mysql start
    2 Starting MySQL.The server quit without updating PID file (/[FAILED]mysql/CloudGame.pid).

    调查问题啊,由于mysql的默认配置情况下,错误日志是在basedir下面,文件名为$HOSTNAME.err,查看文件,既可以看到错误的详情内容。

     1 [root@CloudGame mysql]# ll
     2 total 110632
     3 -rw-rw----. 1 mysql mysql       56 Sep 23 16:51 auto.cnf
     4 -rw-r-----. 1 mysql mysql    17672 Sep 23 17:29 CloudGame.err
     5 -rw-r-----. 1 mysql mysql     3275 Sep 23 16:52 CloudGame.err-bk
     6 -rw-rw----. 1 mysql mysql 12582912 Sep 23 17:07 ibdata1
     7 -rw-rw----. 1 mysql mysql 50331648 Sep 23 17:29 ib_logfile0
     8 -rw-rw----. 1 mysql mysql 50331648 Sep 23 16:51 ib_logfile1
     9 drwx------. 2 mysql mysql     4096 Sep 23 16:55 mysql
    10 drwx------. 2 mysql mysql     4096 Sep 23 16:55 performance_schema
    11 drwx------. 2 mysql mysql     4096 Sep 23 16:55 test
    12 [root@CloudGame mysql]# pwd
    13 /var/lib/mysql

    初始安装的数据库是没有root密码的,即root用户不需要密码即可登录。当MySQL daemon启动的情况下,可以执行mysql_secure_installnation可以设置一下数据库的基本信息。

     1 [root@CloudGame bin]# mysql_secure_installation 
     2 
     3 
     4 
     5 NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
     6       SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
     7 
     8 In order to log into MySQL to secure it, we'll need the current
     9 password for the root user.  If you've just installed MySQL, and
    10 you haven't set the root password yet, the password will be blank,
    11 so you should just press enter here.
    12 
    13 Enter current password for root (enter for none): 
    14 OK, successfully used password, moving on...
    15 
    16 Setting the root password ensures that nobody can log into the MySQL
    17 root user without the proper authorisation.
    18 
    19 Set root password? [Y/n] y
    20 New password: 
    21 Re-enter new password: 
    22 Password updated successfully!
    23 Reloading privilege tables..
    24  ... Success!
    25 
    26 
    27 By default, a MySQL installation has an anonymous user, allowing anyone
    28 to log into MySQL without having to have a user account created for
    29 them.  This is intended only for testing, and to make the installation
    30 go a bit smoother.  You should remove them before moving into a
    31 production environment.
    32 
    33 Remove anonymous users? [Y/n] y 
    34  ... Success!
    35 
    36 Normally, root should only be allowed to connect from 'localhost'.  This
    37 ensures that someone cannot guess at the root password from the network.
    38 
    39 Disallow root login remotely? [Y/n] n
    40  ... skipping.
    41 
    42 By default, MySQL comes with a database named 'test' that anyone can
    43 access.  This is also intended only for testing, and should be removed
    44 before moving into a production environment.
    45 
    46 Remove test database and access to it? [Y/n] n
    47  ... skipping.
    48 
    49 Reloading the privilege tables will ensure that all changes made so far
    50 will take effect immediately.
    51 
    52 Reload privilege tables now? [Y/n] n
    53  ... skipping.
    54 
    55 
    56 
    57 
    58 All done!  If you've completed all of the above steps, your MySQL
    59 installation should now be secure.
    60 
    61 Thanks for using MySQL!
    62 
    63 
    64 Cleaning up...
    65 [root@CloudGame bin]#

    OK,到此,MYSQL 5.6.33的安装结束。 即可正常使用了!

  • 相关阅读:
    Autofac小例子
    Spring自带mock测试Controller
    [转载]转Java 几个memcached 连接客户端对比 选择
    danga的MemcachedClient的几个缺陷
    linux查看memcached状态
    Linux下配置安装PHP环境(Apache2)
    使用memcache.php监控memcached
    memcached运行情况监测
    memcached监控的几种方法(nagios等)
    xmemcached使用的几点优化建议
  • 原文地址:https://www.cnblogs.com/shihuc/p/5901346.html
Copyright © 2011-2022 走看看