CentOS7安装mysql5.6.23
============安装glibc版本==============
一.下载glibc版本的Mysql
mysql-advanced-5.6.23-linux-glibc2.5-x86_64.zip
解压后,得到 mysql-advanced-5.6.23-linux-glibc2.5-x86_64.tar.gz
二.创建Mysql用户
adduser mysql
passwd mysql
二.安装Mysql
注意,glibc版本的Mysql,不是编译版的,是直接编译好的,相当于windows的绿色版
CentOS默认yum源已经没有mysql-server了.而用mariadb代替,而2个数据库冲突,所以要安装mysql,要先卸载mariadb
把mysql-advanced-5.6.23-linux-glibc2.5-x86_64.tar.gz上传到服务器
tar zxvf mysql-advanced-5.6.23-linux-glibc2.5-x86_64.tar.gz
mv mysql-advanced-5.6.23-linux-glibc2.5-x86_64 mysql5.6.23
cd mysql5.6.23
#初始化mysql数据库
scripts/mysql_install_db --user=mysql
#也可以这么初始化
scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --ldata=/var/lib/mysql
三.开启mysql
bin/mysqld_safe --user=mysql
四.执行安全设置
#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密码,当然设置了,输入Y回车
New password: <---输入root密码,并回车,输入的过程中不会有任何显示
Re-enter new password: <---再次输入root密码,并回车,输入的过程中不会有任何显示
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 <---是否删除匿名用户,删除,输入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 <---是否删禁止root用户远程登录,当然禁止,输入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] <---是否删除测试数据库test,删除,输入Y回车
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success! Reloading the privilege tables will ensure that all changes made so far
will take effect immediately. Reload privilege tables now? [Y/n] Y <---刷新权限,输入Y回车
... Success! Cleaning up... All done! If you've completed all of the above steps, your MySQL
installation should now be secure. Thanks for using MySQL!
五.常用命令
#关闭mysql
mysqladmin shutdown
#或
mysqladmin -uroot -p shutdown
============安装rpm版本(补充)==============
如果是centos7以上版本,还是先卸载mariadb
首先创建mysql用户
adduser mysql
下载mysql的安装包
#root用户先下载
curl -O http://cdn.mysql.com//Downloads/MySQL-5.6/MySQL-server-5.6.29-1.el7.x86_64.rpm
curl -O http://cdn.mysql.com//Downloads/MySQL-5.6/MySQL-client-5.6.29-1.el7.x86_64.rpm
#安装mysql server和client
rpm -ivh MySQL-server-5.6.29-1.el7.x86_64.rpm
rpm -ivh MySQL-client-5.6.29-1.el7.x86_64.rpm
然后使用
service mysql start|stop|restart
启动即可
如果碰到不能启动的情况,可使用以下方案
1.关闭seLinux
(网上找教程)
2.权限不足,用chown给mysql赋权
chown -R mysql.mysql /var/lib/mysql
3.重新初始化mysql
mysql_install_db --user=mysql
#恢复数据库参考
mysql_install_db --user=mysql -datadir=/u01/mysql/data
/usr/bin/mysqladmin -u root password '123456'
/usr/bin/mysql_secure_installation
CREATE USER 'scrm'@'%' IDENTIFIED BY 'scrmpwd';
grant all privileges on scrm.* to 'scrm'@'%';
flush privileges;
CentOS7安装mysql5.6.23的更多相关文章
- CentOS7安装mysql5.6.23 -(转)
		
一.下载glibc版本的Mysql mysql-advanced-5.6.23-linux-glibc2.5-x86_64.zip 解压后,得到 mysql-advanced-5.6.23-linux ...
 - Centos7 安装 MySQL5.7
		
Centos7 安装 MySQL5.7 一.环境介绍 1.安装包版本介绍 MySQL 有三种安装方式:RPM安装.二进制包安装.源码包安装.我们这篇文章以二进制方式安装MySQL 软件名称 版本 系统 ...
 - CentOS6.5_64bit下编译安装MySQL-5.6.23
		
转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/44785511 ************************************** ...
 - centos7安装mysql5.7.19及配置远程连接
		
centos7安装mysql5.7.19及配置远程连接------https://blog.csdn.net/Lh19931122/article/details/77996213
 - 学以致用二十七-----Centos7.5二进制安装mysql5.7.23
		
首先去官网查看mysql版本.才一个礼拜不到,我之前下载的是mysql5.7.23,现在在官网页面已然找不到了,只有5.7.24版本,不得不说更新真快.不过我下载的是mysql5.7.23,所以还是安 ...
 - Centos7安装Mysql5.7方法总结 - 实操手册
		
Centos7.x版本下针对Mysql的安装和使用多少跟之前的Centos6之前版本有所不同的,废话就不多赘述了,下面介绍下在centos7.x环境里安装mysql5.7的几种方法:一.yum方式安装 ...
 - centos7 安装mysql5.7及配置
		
一.Mysql 各个版本区别:1.MySQL Community Server 社区版本,开源免费,但不提供官方技术支持.2.MySQL Enterprise Edition 企业版本,需付费,可以试 ...
 - Linux学习第三步(Centos7安装mysql5.7数据库)
		
版本:mysql-5.7.16-1.el7.x86_64.rpm-bundle.tar 前言:在linux下安装mysql不如windows下面那么简单,但是也不是很难.本文向大家讲解了如何在Cent ...
 - Centos7安装mysql-5.7.19
		
Centos7安装Mysql 一 mysql下载 地址: https://dev.mysql.com/downloads/mysql/#downloads 二 在centos7上创建安装文件存放.解压 ...
 
随机推荐
- JSP基础——创建、启动、浏览项目
			
创建的项目类型为WEB PROJECT. 新建的.JSP文件,可直接访问的放到WebRoot目录下,不可直接访问的就放到WEB-INF里. 要添加的.jar文件,复制到项目目录内,再右键Build P ...
 - HDU5739 Fantasia(点双连通分量 + Block Forest Data Structure)
			
题目 Source http://acm.hdu.edu.cn/showproblem.php?pid=5739 Description Professor Zhang has an undirect ...
 - BZOJ4444 : [Scoi2015]国旗计划
			
首先将坐标离散化,因为区间互不包含,可以理解为对于每个起点输出最少需要多少个战士. 将环倍长,破环成链,设$f[i]$表示区间左端点不超过$i$时右端点的最大值,可以通过$O(n)$递推求出. 那么如 ...
 - Boom.TV完成350万美元融资,目标直指VR电竞直播
			
3D在线电竞直播平台Boom.tv刚刚宣布已经完成350万美元的融资,该平台旨在让观众在任何设备以任意视角观看电竞比赛,并将支持VR版本. 这家位于美国加州红木城的初创公司成立于2015年,由Gupt ...
 - Mongoose简单学习笔记
			
1.1 名词解释 Schema : 一种以文件形式存储的数据库模型骨架,不具备数据库的操作能力 Model : 由Schema发布生成的模型,具有抽象属性和行为的数据库操作对 Entity : 由Mo ...
 - ACM 找球号(一)
			
找球号(一) 时间限制:3000 ms | 内存限制:65535 KB 难度:3 描述 在某一国度里流行着一种游戏.游戏规则为:在一堆球中,每个球上都有一个整数编号i(0<=i<= ...
 - 使用audio标签播放音频文件
			
HTML5定义了一个新的元素用来指定标准的方式来插入音频文件到web页面中:<audio>标签.使用audio标签可以控制音频的播放与停止,循环播放与播放次数设置,以及播放位置等等. 例如 ...
 - 附件上传 使用javascript
			
<html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat=&quo ...
 - cookie的设置、获取和删除封装
			
在我们为了去完成数据储存,有时会用到cookie,简单封装一下cookie: <!DOCTYPE html> <html lang="en"> <he ...
 - [CareerCup] 17.6 Sort Array 排列数组
			
17.6 Given an array of integers, write a method to find indices m and n such that if you sorted elem ...