快速部署MySQL数据库
一.下载对应的软件版本
下载地址:http://mirrors.sohu.com/mysql/MySQL-5.6/
备用地址:http://ftp.ntu.edu.tw/pub/MySQL/Downloads/
[root@localhost ~]# wget -q http://mirrors.sohu.com/mysql/MySQL-5.6/sql-5.6.36-linux-glibc2.5-x86_64.tar.gz
二、解压、配置用户和权限
[root@localhost ~]# mkdir -pv /Data/apps
[root@localhost ~]# tar xf mysql-5.6.-linux-glibc2.-x86_64.tar.gz -C /Data/apps/
[root@localhost ~]# cd /Data/apps/
[root@localhost apps]# mv mysql-5.6.-linux-glibc2.-x86_64/ mysql-5.6.
[root@localhost ~]# useradd -s /sbin/nologin -M mysql
[root@localhost ~]# chown -R mysql.mysql /Data/apps/mysql-5.6.
[root@localhost ~]# cd /Data/apps/mysql-5.6.
三、初始化数据库
[root@localhost mysql-5.6.]# cp support-files/my-default.cnf /etc/my.cnf
[root@localhost mysql-5.6.]# ./scripts/mysql_install_db --basedir=/Data/apps/mysql-5.6./ --datadir=/Data/apps/mysql-5.6./data/ --user=mysql
[root@localhost mysql-5.6.]# cp support-files/mysql.server /etc/init.d/mysqld
[root@localhost mysql-5.6.]# chmod +x /etc/init.d/mysqld
[root@localhost mysql-5.6.]# sed -i 's#/usr/local/mysql#/Data/apps/mysql-5.6.36#g' /etc/init.d/mysqld #主要最后都没有'/'
[root@localhost mysql-5.6.]# service mysqld start
Starting MySQL.Logging to '/Data/apps/mysql-5.6.36/data/localhost.localdomain.err'.
.. [确定]
[root@localhost mysql-5.6.]# netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0.0.0.0: 0.0.0.0:* LISTEN /sshd
tcp ::: :::* LISTEN /sshd
tcp :::
四、配置MySQL环境变量
[root@localhost mysql-5.6.36]# echo "export PATH=/Data/apps/mysql-5.6.36/bin:$PATH" > /etc/profile.d/mysql.sh
[root@localhost mysql-5.6.36]# . /etc/profile.d/mysql.sh
五、测试登录
root@localhost mysql-5.6.]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.6. MySQL Community Server (GPL) Copyright (c) , , Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> select version();
+-----------+
| version() |
+-----------+
| 5.6. |
+-----------+
row in set (0.05 sec) mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
rows in set (0.15 sec)
六、配置安全策略(建议)
[root@localhost mysql-5.6.]# 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):
.................................
..............................略
快速部署MySQL数据库的更多相关文章
- 2.快速部署MySQL主从复制
1.快速部署MySQL主从复制 [root@mysql ~]# mysql -uroot -p123456 -S /data/3307/mysql.sock -e "show slave ...
- 在Centos上安装docker,部署mysql数据库
何为docker? Docker 可以让开发者打包他们的应用以及依赖包到一个轻量级.可移植的容器中,然后发布到任何流行的 Linux 机器上,也可以实现虚拟化. 本机环境 24小时不关机的Centos ...
- 利用Docker快速部署Mysql
写在前面 我又来更新了~~~,今天内容较少,主要是利用Docker快速部署Mysql和初始化数据 利用Docker下载Mysql 简洁明了,在命令提示符中输入 docker pull mysql:8. ...
- 如何利用 docker 快速部署 Mysql 服务
docker 基础教程不再多说,这里只着重讲如何使用 docker 部署 mysql 服务 docker 拉取 访问 dockerhub,搜索关键词 mysql,我这里选择 mysql-server, ...
- 一分钟在云端快速创建MySQL数据库实例
本教程将帮助您了解如何使用Azure管理门户迅速创建,连接,配置MySQL 数据库 on Azure.完成本教程后,您将在Azure上拥有一个示例MySQL数据库服务器,并了解如何使用管理门户执行基本 ...
- 打通版微社区(2):服务器部署MySql数据库 For DZ3.2
写在前面:单独写部署MySql原因是,我这边的应用数据库都是独立存在的,数据与应用分别部署在不同的服务器.另外我也没有实际部署MySql的经验,特意写一篇日志,张记性.安装MySql参考了http:/ ...
- 这38个小技巧告诉你如何快速学习MySQL数据库2
1.如何快速掌握MySQL? ⑴培养兴趣兴趣是最好的老师,不论学习什么知识,兴趣都可以极大地提高学习效率.当然学习MySQL 5.6也不例外.⑵夯实基础计算机领域的技术非常强调基础,刚开始学习可能还认 ...
- 这38个小技巧告诉你如何快速学习MySQL数据库
1.如何快速掌握MySQL? ⑴培养兴趣兴趣是最好的老师,不论学习什么知识,兴趣都可以极大地提高学习效率.当然学习MySQL 5.6也不例外.⑵夯实基础计算机领域的技术非常强调基础,刚开始学习可能还认 ...
- Windows Server系统部署MySQL数据库
由于工作需要在阿里云服务器中使用MySQL,所以安装一下MySQL数据库,中间也踩了一些坑,现在将整个过程给大家记录下来,便于后续查找. 阿里云服务器是WinServer2012系统,之前在Windo ...
随机推荐
- 不用修改 hosts 本地开发(续篇)
上一篇说过不修改 hosts 在 Chrome 中可以使用 *.localhost 进行绑定域名开发. 但只能用于 Chrome 中,今天找了一个还有一些好心人提供了域名指向 127.0.0.1 . ...
- html+css常用总结
一,HTML结构: 1,DOCTYPE 2,head: title:网站的标题 meta charset 3,body: 二,HTML标签: 块状元素和内联元素: 常见的块级元素有:div.p.add ...
- redis实现与分析-单机数据库实现
数据库 1,1个数据库数据结构和上面一样,两个字典,一个包含所有的键,一个包含了键的过期时间 2,redis删除过期键策略:定期+惰性 定期:一段时间开始删,删不全下次继续删 惰性:使用键的时候检察 ...
- 编译小米mini openwrt
编译小米mini openwrt 1.下载openwrt源码包:进入要下载保存的文件目录,输入 git clone git://git.openwrt.org/15.05/openwrt.git 2. ...
- SSM整个配置心得
个人整合心得,还望指正
- 关于libusb-win32开发的经验
引用:http://blog.sina.com.cn/s/blog_4b4b54da010153zb.html 作为设备开发者, 一般需要让设备与上位机PC通讯, 我们往往考虑采用以下几种接口: rs ...
- Base64 转 图片
static void Main(string[] args) { string s = "iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAIAAAABc2X6AAAAC ...
- 黄聪:VS2017调试时提示“运行时无法计算表达式的值”
具体操作: 工具-选项-调试-常规,选中“使用托管兼容模式”,问题解决
- C++进阶--不让编译器自动生成类函数
//############################################################################ /* * 不让编译器自动生成类函数 * * ...
- Oracle随机排序函数和行数字段
随机排序函数dbms_random.value()用法:select * from tablename order by dbms_random.value() 行数字段rownum用法:select ...