##################################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. BZOJ 1927: [Sdoi2010]星际竞速 [上下界费用流]

    1927: [Sdoi2010]星际竞速 题意:一个带权DAG,每个点恰好经过一次,每个点有曲速移动到他的代价,求最小花费 不动脑子直接上上下界费用流过了... s到点连边边权为曲速的代价,一个曲速移 ...

  2. BZOJ 2594: [Wc2006]水管局长数据加强版 [LCT kruskal]

    2594: [Wc2006]水管局长数据加强版 Time Limit: 25 Sec  Memory Limit: 128 MBSubmit: 2917  Solved: 918[Submit][St ...

  3. MySQL中order by排序时,数据存在null咋办

    order by排序是最常用的功能,但是排序有时会遇到数据为空null的情况,这样排序就会乱了,这里以MySQL为例,记录我遇到的问题和解决思路. 问题: 网页要实现table的行鼠标拖拽排序,我用A ...

  4. 【考试】java基础知识测试,看你能得多少分?

    1 前言 共有5道java基础知识的单项选择题,每道20分,共计100分.解析和答案在最后. 2 试题 2.1 如下程序运行结果是什么? class Parent { public Parent(St ...

  5. [翻译]编写高性能 .NET 代码 第一章:工具介绍 -- Performance Counters(性能计数器)

    <<返回目录 Performance Counters(性能计数器) 性能计数器是监视应用程序和系统性能的最简单的方法之一.它有几十个类别数百个计数器在,包括一些.net特有的计数器.要访 ...

  6. Python常用数据结构之heapq模块

    Python数据结构常用模块:collections.heapq.operator.itertools heapq 堆是一种特殊的树形结构,通常我们所说的堆的数据结构指的是完全二叉树,并且根节点的值小 ...

  7. MysqL 主从事务数据安全之sync_binlog

    sync_binlog:是MySQL 的二进制日志(binary log)同步到磁盘的频率(刷新二进制日志到磁盘),默认是0,意味着mysql并不刷新,由操作系统自己决定什么时候刷新缓存到持久化设置, ...

  8. Duilib第一步(II)-Hello World

    My first Duilib program 1. Prepare for development 打开DuiFarm项目DuiFarm.cpp文件,将除_tWinMain函数之外所有内容删除.删除 ...

  9. Qt 网络模块如何使用?

    1.网络模块介绍 类名 说明 中文 QAbstractNetworkCache The interface for cache implementations 缓存实现的接口 QNetworkCach ...

  10. c#IO的学习

    常见应用方面 一.路径的相关操作,如判定路径是否合法,路径类型,路径的特定部分,合并路径,系统文件夹路径等内容:二.相关通用文件对话框,这些对话框可以帮助我们操作文件系统中的文件和目录:三.文件.目录 ...