Linux 期中架构 MySQL
MySQL基础部分
mysql安装脚本
安装前请将相关安装包copy放到/server/tools目录下
-rw-r--r-- 1 root root 314149697 Mar 23 2017 mysql-5.6.34-linux-glibc2.5-x86_64.tar.gz
执行安装脚本:
#!/bin/bash
#install MySQL
#新增用户
useradd -M -s /sbin/nologin mysql
#进入软件目录
cd /server/tools
#解压
tar xf mysql-5.6.34-linux-glibc2.5-x86_64.tar.gz
#移动目录并创建软连接
mv mysql-5.6.34-linux-glibc2.5-x86_64 /application/mysql-5.6.34
ln -s /application/mysql-5.6.34/ /application/mysql
#授权
chown -R mysql.mysql /application/mysql/data/
#初始化程序
/application/mysql/scripts/mysql_install_db --basedir=/application/mysql --datadir=/application/mysql/data --user=mysql
#配置启动脚本进行授权
cp /application/mysql/support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
sed -i 's#/usr/local/mysql#/application/mysql#g' /application/mysql/bin/mysqld_safe /etc/init.d/mysqld
\cp /application/mysql/support-files/my-default.cnf /etc/my.cnf #优化:将命令增加到环境变量
echo 'export PATH=/application/mysql/bin:$PATH' >>/etc/profile
source /etc/profile #加入开机自启动
chkconfig --add mysqld
chkconfig mysqld on
#启动服务
/etc/init.d/mysqld start
安装完后执行ps-ef | grep mysql查看
[root@web01 tools]# ps -ef | grep mysql
root 10937 1 0 19:53 pts/2 00:00:00 /bin/sh /application/mysql/bin/mysqld_safe --datadir=/application/mysql/data --pid-file=/application/mysql/data/web01.pid
mysql 11053 10937 0 19:53 pts/2 00:00:01 /application/mysql/bin/mysqld --basedir=/application/mysql --datadir=/application/mysql/data --plugin-dir=/application/mysql/lib/plugin --user=mysql --log-error=/application/mysql/data/web01.err --pid-file=/application/mysql/data/web01.pid
root 11162 10821 0 20:19 pts/2 00:00:00 grep mysql
给mysql用户设置密码
[root@web01 ~]# mysqladmin -u root password 'oldboy123' --设置root密码为oldboy123
Warning: Using a password on the command line interface can be insecure.
[root@web01 ~]# mysql -uroot -poldboy123 --登录root用户
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.6.34 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, 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> quit --退出
Bye
Linux 期中架构 MySQL的更多相关文章
- Linux 期中架构 Ansible
ansible 自动化软件 基于Python开发 特点概述: 配置文件不需要过多配置 了解就可以了 ###部署ansble软件 ##受控主机部署 backup nfs01 web01 ...
- Linux 期中架构 PHP
环境 PHP安装前准备 先将需要的软件包如下位置放置.另外需要有WWW用户 参照nginx 满足以上条件后执行安装脚本 PHP安装脚本: #!/bin/bash #install PHP #au ...
- Linux 期中架构 inotify
全网备份数据同步方案 备份网站内部人员信息 不能解决外部(人员)上传数据的备份 定时任务最短执行的周期为一分钟,采用定时任务方式,有时可能造成一分钟内的数据丢失 因此对于重要数据需要采用实时同步的方 ...
- Linux 期中架构 rsync
上篇 Rsync rysnc查看版本 --version 全量 与增量在效率上有区别 cp mv scp --全量复制 rsync --增量复制 rsync利用的是quick ch ...
- Linux期中架构
1 在构建完模板后 开启虚拟机后 需要再重启一次 以解决网卡不能看见的问题 ########################################add begin 2018-05 ...
- Linux 期中架构 SSH
为其他网络服务提供安全协议.替代Telnet SSH: 实现数据加密传输 22 默认支持root用户远程连接 类似sftp-server服务 nmap -p 22 10.0.0.41 nc 10 ...
- Linux期中架构 全网备份案例
server端脚本 #!/bin/bash #1 进行数据完整性验证 并生成结果 find /backup -type f -name "finger.txt"| xargs md ...
- linux 期中架构之 nginx 安装与排错
1, 安装 nginx 所需要的pcre库 即:perl 兼容正则表达式 yum install pcre pcre-devel -y rpm -qa pcre pcre-devel 检查是否安装好p ...
- Linux运维就业技术指导(八):期中架构考核
一,期中架构考核概述 1.1 架构图 1.2 架构图公司背景概述 公司是一个新兴的人脸识别高新创业公司,公司名称xxxx 老总是博士生导师,还有一个副总是研究生导师 副总同时是研发总监,负责所有的研发 ...
随机推荐
- ESET Smart Security 6 – 免费60天(SG)
ESS 60天 - 活动消息来自新加坡脸谱https://www.facebook.com/esetsingapore/app_190322544333196IP限制Sg,suiss提供个在线代理ht ...
- logback转义符与MDC
关于MDC的使用,可以结合filter一块使用,将需要串联的上下文的关键信息,通过header进行传递,然后通过配置%X{userId}将信息打印出来. MDC.put("userId&qu ...
- ApplicationContext详解以及多个ApplicationContext.xml的相互引用
如果说BeanFactory是spring的心脏,那么Application就是完整的身躯.ApplicationContext就是由BeanFactory派生出来的. 一.ApplicationCo ...
- WiFi Pineapple的Karma攻击与原理探究
WiFi钓鱼是一种被炒烂了的安全威胁,你几乎每天都能从电视.网络媒体中看到因误连了恶意WiFi导致大笔资金失窃的案例,并且很多媒体语不惊人死不休的报道风格总是能把当事人的受害过程删减修饰到灵异的程度. ...
- 揭秘Keras推荐系统如何建立模型、获取用户爱好
你是否有过这样的经历?当你在亚马逊商城浏览一些书籍,或者购买过一些书籍后,你的偏好就会被系统学到,系统会基于一些假设为你推荐相关书目.为什么系统会知道,在这背后又藏着哪些秘密呢? 荐系统可以从百万甚至 ...
- HDU 2181 哈密顿绕行世界问题(DFS)
Problem Description 一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市. Input 前20行的第i行有3个数, ...
- CentOS7安装OpenStack(Rocky版)-06.安装Neutron网络服务(控制节点)
上一章介绍了独立的nova计算节点的安装方法,本章分享openstack的网络服务neutron的安装配制方法 ------------------- 完美的分割线 ----------------- ...
- pip source
linux版本 sudo vim .pip/pip.conf[global]index-url = http://pypi.douban.com/simple[install]trusted-host ...
- xdoj 1044---炸红花 (话说 小时候经常玩这个被虐。。。。qwq)
// 我真的好笨 只会枚举 话说那个ac的370b到底是怎么做的 /(ㄒoㄒ)/~~ #include <iostream> #include <algorithm> usin ...
- 【MVC】View与Control之间数据传递
1. Controller向View传递数据 使用ViewData传递数据[弱类型,字典型ViewDataDictionary] ViewData[“Message_ViewData”] = “ He ...