centos6.5 yum安装MySQL5.6
- 创建MySQL用户
#useradd mysql
#passwd mysql
#chmod u+w /etc/sudoers
#vi /etc/sudoers
mysql ALL=(ALL) ALL
- 安装仓库
要使用yum 安装mysql,要使用mysql的yum仓库,先从官网下载适合你系统的仓库
http://dev.mysql.com/downloads/repo/yum/
然后安装一下这个仓库列表
wget http://repo.mysql.com//mysql57-community-release-el6-8.noarch.rpm
rpm -ivh mysql-community-release-el6-5.noarch.rpm
或:
# yum install http://repo.mysql.com//mysql57-community-release-el6-8.noarch.rpm
- 选择版本
查看可安装的mysql版本
[mysql@mysql- ~]$ yum repolist enabled | grep "mysql.*-community.*"
mysql-connectors-community MySQL Connectors Community
mysql-tools-community MySQL Tools Community
mysql57-community MySQL 5.7 Community Server
如果我们要选择版本,可以先执行下面这个命令查看一下有哪些版本
[mysql@mysql- ~]$ yum repolist all | grep mysql
选择版本,启用5.6版本的,禁用5.7版本子仓库
[mysql@mysql- ~]$ sudo yum-config-manager --enable mysql56-community
[mysql@mysql- ~]$ sudo yum-config-manager --disable mysql57-community
或者
编辑/etc/yum.repos.d/mysql-community.repo文件
enabled=0 表示禁用
比如要安装5.7版本的mysql,要确定5.6的enabled=0,5.7的enabled=1,一次保证只启用一个子仓库
查看可安装的mysql版本
[mysql@mysql- ~]$ yum repolist enabled | grep "mysql.*-community.*"
mysql-connectors-community MySQL Connectors Community
mysql-tools-community MySQL Tools Community
mysql56-community MySQL 5.6 Community Server
- 安装
[mysql@mysql- ~]$ sudo yum install mysql-community-server
- 启动数据库
[root@mysql- mysql]# service mysqld strat
用法:/etc/init.d/mysqld {start|stop|status|restart|condrestart|try-restart|reload|force-reload}
[root@mysql- mysql]# service mysqld start
初始化 MySQL 数据库: -- :: [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
-- :: [Note] /usr/sbin/mysqld (mysqld 5.6.) starting as process ...
-- :: [Note] InnoDB: Using atomics to ref count buffer pool pages
-- :: [Note] InnoDB: The InnoDB memory heap is disabled
-- :: [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
-- :: [Note] InnoDB: Memory barrier is not used
-- :: [Note] InnoDB: Compressed tables use zlib 1.2.
-- :: [Note] InnoDB: Using Linux native AIO
-- :: [Note] InnoDB: Using CPU crc32 instructions
-- :: [Note] InnoDB: Initializing buffer pool, size = 128.0M
-- :: [Note] InnoDB: Completed initialization of buffer pool
-- :: [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
-- :: [Note] InnoDB: Setting file ./ibdata1 size to MB
-- :: [Note] InnoDB: Database physically writes the file full: wait...
-- :: [Note] InnoDB: Setting log file ./ib_logfile101 size to MB
-- :: [Note] InnoDB: Setting log file ./ib_logfile1 size to MB
-- :: [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
-- :: [Warning] InnoDB: New log files created, LSN=
-- :: [Note] InnoDB: Doublewrite buffer not found: creating new
-- :: [Note] InnoDB: Doublewrite buffer created
-- :: [Note] InnoDB: rollback segment(s) are active.
-- :: [Warning] InnoDB: Creating foreign key constraint system tables.
-- :: [Note] InnoDB: Foreign key constraint system tables created
-- :: [Note] InnoDB: Creating tablespace and datafile system tables.
-- :: [Note] InnoDB: Tablespace and datafile system tables created.
-- :: [Note] InnoDB: Waiting for purge to start
-- :: [Note] InnoDB: 5.6. started; log sequence number
-- :: [Note] Binlog end
-- :: [Note] InnoDB: FTS optimize thread exiting.
-- :: [Note] InnoDB: Starting shutdown...
-- :: [Note] InnoDB: Shutdown completed; log sequence number -- :: [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
-- :: [Note] /usr/sbin/mysqld (mysqld 5.6.) starting as process ...
-- :: [Note] InnoDB: Using atomics to ref count buffer pool pages
-- :: [Note] InnoDB: The InnoDB memory heap is disabled
-- :: [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
-- :: [Note] InnoDB: Memory barrier is not used
-- :: [Note] InnoDB: Compressed tables use zlib 1.2.
-- :: [Note] InnoDB: Using Linux native AIO
-- :: [Note] InnoDB: Using CPU crc32 instructions
-- :: [Note] InnoDB: Initializing buffer pool, size = 128.0M
-- :: [Note] InnoDB: Completed initialization of buffer pool
-- :: [Note] InnoDB: Highest supported file format is Barracuda.
-- :: [Note] InnoDB: rollback segment(s) are active.
-- :: [Note] InnoDB: Waiting for purge to start
-- :: [Note] InnoDB: 5.6. started; log sequence number
-- :: [Note] Binlog end
-- :: [Note] InnoDB: FTS optimize thread exiting.
-- :: [Note] InnoDB: Starting shutdown...
-- :: [Note] InnoDB: Shutdown completed; log sequence number PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands: /usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h mysql- password 'new-password' Alternatively you can run: /usr/bin/mysql_secure_installation which will also give you the option of removing the test
databases and anonymous user created by default. 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 Note: new default config file not created.
Please make sure your config file is current 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 [确定]
正在启动 mysqld: [确定]
- 安全配置
[root@mysql- mysql]# /usr/bin/mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here. Enter current password for root (enter for none): ----输入root密码(默认为空):
OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation. Set root password? [Y/n] y ----是否要修改root密码:
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success! By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment. Remove anonymous users? [Y/n] y
... Success! Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] y
... Success! By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment. Remove test database and access to it? [Y/n] n
... skipping. Reloading the privilege tables will ensure that all changes made so far
will take effect immediately. Reload privilege tables now? [Y/n] y
... Success! All done! If you've completed all of the above steps, your MySQL
installation should now be secure. Thanks for using MySQL! Cleaning up...
[root@mysql- mysql]#
[root@mysql- mysql]# service mysqld status
mysqld (pid ) 正在运行...
centos6.5 yum安装MySQL5.6的更多相关文章
- Centos6.8 yum安装MySQL5.6
第一步:安装仓库wget http://repo.mysql.com//mysql57-community-release-el6-8.noarch.rpmrpm -ivh mysql-communi ...
- centos6.x yum 安装 mysql5.6 mysql5.7
先卸载低版本MYSQL yum remove mysql* rpm -ivh http://repo.mysql.com/mysql-community-release-el6.rpm yum ins ...
- CentOS6.8 yum 安装 mysql5.7.12 完美步骤
一,wget http://dev.mysql.com/get/mysql57-community-release-el6-8.noarch.rpm 二,yum localinstall mysql5 ...
- CentOS6.8通过yum安装MySQL5.7
Centos6.8通过yum安装mysql5.7 1.安装mysql的yum源 a.下载配置mysql的yum源的rpm包 根据上面3张图片中的操作下载下来的rpm文件可以通过如下命令获取: wget ...
- Centos6.5使用yum安装Mysql5.7
想要玩新的东东就要付出代价,我的时间悄悄的都溜走了,说多了都是泪! 实践才是真理! 系统版本:Linux localhost.localdomain 2.6.32-431.el6.x86_64 #1 ...
- 在centos6.5中安装mysql5.7
简介 博主最近在研究mysql的读写分离和主从复制,一台master和两台slave,三台机器在同一个局域网中,首先就就要在centos6.5中安装mysql5.7.好了,废话不多说,接下来进入正题. ...
- centos6.7编译安装mysql5.7.17
centos6.7编译安装mysql5.7.17 2017-03-24 09:57:15 提示:mysql5.7.17和之前5.56以前的版本安装不一样,需要用cmake 另外,看本文档的mysql编 ...
- CentOS6.7上安装Mysql5.7
CentOS6.7上安装Mysql5.7 2017年07月22日 18:27:05 阅读数:564 环境的配置总是令人作呕,所以这次表明版本条件: 首先,这是一台新机器 其次,CentOS版本如下: ...
- CentOS6、7安装MySQL5.7全教程
CentOS6.7安装MySQL5.7全教程 做开发总得用到数据吧,Linux作为服务器,总得有一个数据库来存储测试用的数据,所以呢,这里附上CentOS6.7安装MySQL5.7的教程喔~ 用到的工 ...
随机推荐
- 【C#】读书笔记
一,C#对象初始化语法: Product p = new Product() { Name = "小黄人", Price = , Description = "机智&qu ...
- 关于hibernate中的 lazy="false“
如上图所示,warehousePicked 中包含了warehousePicking 同时,数据库中warehousePicking存在数据 ,但是在debug 时warehousePicked的be ...
- 【02】使用Firebug查看和编辑HTML和CSS
使用Firebug查看和编辑HTML和CSS 描述 在本章节的教程中,我们将讨论如何使用Firebug查看和编辑HTML和CSS. 使用Firebug查看和编辑HTML 在你要查看的元素上右击鼠标然后 ...
- 【转】关于RabbitMQ
1 什么是RabbitMQ? RabbitMQ是实现AMQP(高级消息队列协议)的消息中间件的一种,最初起源于金融系统,用于在分布式系统中存储转发消息,在易用性.扩展性.高可用性等方面表现不 ...
- OSPF选路原则
1:O路由>Oia路由>external路由! O:计算LSA-1和LSA-2,前提age不能MaxAge,metric不能LSinfinity,计算出来的最小metric的路由放入RIB ...
- [BZOJ3052][UOJ#58][WC2013]糖果公园
[BZOJ3052][UOJ#58][WC2013]糖果公园 试题描述 Candyland 有一座糖果公园,公园里不仅有美丽的风景.好玩的游乐项目,还有许多免费糖果的发放点,这引来了许多贪吃的小朋友来 ...
- HDU1002 大数相加
#include <iostream> #include <iostream> #include <iomanip> #include<string> ...
- bzoj1709 [Usaco2007 Oct]Super Paintball超级弹珠 暴力
[Usaco2007 Oct]Super Paintball超级弹珠 Description 奶牛们最近从著名的奶牛玩具制造商Tycow那里,买了一套仿真版彩弹游戏设备(类乎于真人版CS). Bess ...
- Linux(4):文件属性
文件属性: # 重点: 磁盘空间不足 和 软链接与硬链接的区别 查看文件的属性: # ls lhi 文件 [root@NEO ~]# ls -lhi /etc/hosts 130078 -rw-r-- ...
- spring security3.1升级到4.1问题(1)访问/j_spring_security_check 404
升级完后,发现登录不进去,把post改成get好了,但是系统的提交表单功能都不能用了,也是解决了很长时间,最后找到了根本原因. spring sercurity 4.0 csrf保护是默认开启的,cs ...