##################################mysql 2进制安装和简单优化#######################################################

mkdir /home/fly/tools
cd /fly/tools/
rz -y #上传
ls
useradd -s /sbin/nologin -M mysql #建用户
id mysql
tar xf mysql-5.6.39-linux-glibc2.12-x86_64.tar.gz#解压
mkdir /application
mv mysql-5.6.39-linux-glibc2.12-x86_64 /application/ #相当于编译安装 速度块
cd /application/
ln -s /application/mysql-5.6.39-linux-glibc2.12-x86_64 /application/mysql #软连接
ll /application/mysql/
/application/mysql/scripts/mysql_install_db --basedir=/application/mysql/ --datadir=/application/mysql/data/ --user=mysql #初始化
yum install -y perl perl-devel #根据提示看是否需要这个包
chown -R mysql.mysql /application/mysql #配置权限
vi /etc/hosts #解析主机名 echo "192.168.1.65 mysql_66" >>/etc/hosts
yum install -y libaio* #看提示是否需要这2个包
yum install -y libnuma*
/application/mysql/scripts/mysql_install_db --basedir=/application/mysql/ --datadir=/application/mysql/data/ --user=mysql #安装成功会返回2个ok
echo $? #看是否成功 返回0成功
/application/mysql//bin/mysqld_safe &(启动)
cp /application/mysql/support-files/my-default.cnf /etc/my.cnf #配置/etc/init.d/mysqld 启动
sed -i 's#/usr/local/mysql#/application/mysql#g' /application/mysql/bin/mysqld_safe /application/mysql/support-files/mysql.server
cp /application/mysql/support-files/mysql.server /etc/init.d/mysqld
/etc/init.d/mysqld start #启动
Starting MySQL.Logging to '/application/mysql/data/mysql_66.err'.
... SUCCESS!
lsof -i :3306
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mysqld 1492 mysql 10u IPv6 13492 0t0 TCP *:mysql (LISTEN)
cp /application/mysql/bin/* /usr/local/sbin/
mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.39 MySQL Community Server (GPL)

Copyright (c) 2000, 2018, 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> exit
Bye
mysqladmin -uroot password 123456 #设置密码
Warning: Using a password on the command line interface can be insecure.
mysqladmin -uroot -p123456 password 123456 #修改密码
Warning: Using a password on the command line interface can be insecure.
mysql -uroot -p123456 #进入数据库
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.39 MySQL Community Server (GPL)

Copyright (c) 2000, 2018, 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> show databases; #优化
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.05 sec)

mysql> drop database test;
Query OK, 0 rows affected (0.10 sec)

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)

mysql> select user,host from mysql.user;
+------+-----------+
| user | host |
+------+-----------+
| root | 127.0.0.1 |
| root | ::1 |
| | localhost |
| root | localhost |
| | mysql\_66 |
| root | mysql\_66 |
+------+-----------+
6 rows in set (0.00 sec)

mysql> drop user 'root'@'::1';
Query OK, 0 rows affected (0.04 sec)

mysql> drop user ''@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> drop user ''@'mysql\_66';
Query OK, 0 rows affected (0.00 sec)

mysql> select user,host from mysql.user;
+------+-----------+
| user | host |
+------+-----------+
| root | 127.0.0.1 |
| root | localhost |
| root | mysql\_66 |
+------+-----------+
3 rows in set (0.00 sec)

mysql> drop user 'root'@'mysql\_66';
Query OK, 0 rows affected (0.03 sec)

For server side help, type 'help contents'

mysql> flush privileges
-> ;
Query OK, 0 rows affected (0.00 sec)

 

[mysql] 2进制安装和简单优化的更多相关文章

  1. mysql 10进制与35进制之间的转换 注意Power处理bigint的问题

    35进制的目的是防止0和O造成的视觉误差 BEGIN    DECLARE m_StrHex35 VARCHAR(100); -- 返回35进制表示的结果  DECLARE m_Remainder B ...

  2. Ecust DIV3 k进制 【暴力不断优化】

    K进制 Description 给定一个正整数n,请你判断在哪些进制下n的表示恰好有2位是1,其余位都是0. Input 输入第一行为整数TT,表示有TT组数据(1 \le T \le 50)(1≤T ...

  3. HDU 1197 Specialized Four-Digit Numbers (枚举+进制转化,简单)

    题意:让求从2992-9999中所有数字,满足10进制各位之和和12进制和16进制各位数字之和相等. 析:没啥可说的,只能枚举从2992-9999,每个进制都算一下. 代码如下: #include & ...

  4. c++ 作业 10月13日 进制转换最简单方法,控制c++输出格式方法 教材50的表格自己实践一下 例题3.1 setfill() setw()

    #include <iostream> #include <iomanip> using namespace std; int main(){ // int i; // cou ...

  5. MySQL数据库sql语句的一些简单优化

    1.查询条件的先后顺序 有多个查询条件时,要把效率高能更精确筛选记录的条件放在后边.因为MySQL解析sql语句是从后往前的(不知是否准确). 例: select a.*,b.* from UsrIn ...

  6. 修复tunl0-二进制安装calico

    这篇博文很重要,出现这个问题导致pod之间无法通讯,pod无法连接外网. 出现的问题是二进制方式安装了节点之后, tunl0没有显示,通过ifconfig tunl0 up 启动tunl0 没有意义, ...

  7. Mysql单实例数据库安装

    第1章 MySQL数据库安装 在当今的大中型互联网企业里,MySQL数据库服务几乎都是运行在Linux系列操作系统上,当然,你在可以运行在Windows/Unix等商业操作系统上,大中型互联网企业使用 ...

  8. (大数 万进制) N! hdu1042

    N! Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others) Total Subm ...

  9. C++实现进制转换

    知识内容: 1.string类基本使用 2.10进制转2进制 3.10进制转8进制和10进制转16进制 4.上述3种转换的递归实现 注:进制的表示: 二进制:开头是0b,eg: 0b1011(注:c/ ...

随机推荐

  1. new function

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...

  2. Linux系统下LNMP一键搭建Linux、PHP、MySQL环境(适合新手搭建linux下的web生成环境)

    一. 首先要解释一下,什么是LNMP,LNMP起源于LAMP,LAMP是Linux+Apache+Mysql/MariaDB+Perl/PHP/Python的缩写,这里将Web服务端的Apache替换 ...

  3. python中的string

    也可以用一个变量来保存字符串,然后输出str = ‘bad’print str 如果你想表示一段带有英文单引号或者双引号的文字,那么表示这个字符串的引号就要与内容区别开. 内容带有单引号,就用双引号表 ...

  4. javascript 一些特殊的字符运算

    1.什么是 --> ? 这两个分开是很简单的两个运算符,比如--,一般表示自减,var i = 5;while(i){console.log(i--);},会打印出5,4,3,2,1: > ...

  5. file_put_contents写入文字换行

    file_put_contents写入文字换行 注意要使用双引号 "\r\n"

  6. 【深度学习系列】用PaddlePaddle进行车牌识别(一)

    小伙伴们,终于到了实战部分了!今天给大家带来的项目是用PaddlePaddle进行车牌识别.车牌识别其实属于比较常见的图像识别的项目了,目前也属于比较成熟的应用,大多数老牌厂家能做到准确率99%+.传 ...

  7. CentOS6.9安装mysql5.7

    1.查看系统版本 uname -a 2.卸载old mysql rpm -qa|grep -i mysql rpm -ev MySQL-client-5.5.25a-1.rhel5 如果提示依赖错误, ...

  8. selenium自动化测试配置工具整理

    firefox浏览器历史版本 网址通道:http://ftp.mozilla.org/pub/firefox/releases/ chromedriver历史版本 网址通道:http://chrome ...

  9. springBoot之配置文件的读取以及过滤器和拦截器的使用

    前言 在之前的学习springBoot中,成功的实现了Restful风格的基本服务.但是想将之前的工程作为一个项目来说,那些是仅仅不够的.可能还需要获取自定义的配置以及添加过滤器和拦截器.至于为什么将 ...

  10. C# 快速高效率复制对象的几种方式

    http://www.cnblogs.com/emrys5/p/expression_trans_model.html 这篇较具体. 本文基于上文略加改动,暂记 using Newtonsoft.Js ...