广告
返回顶部
首页 > 资讯 > 数据库 >Linux+MySQL运维的基础命令
  • 738
分享到

Linux+MySQL运维的基础命令

2024-04-02 19:04:59 738人浏览 泡泡鱼
摘要

生产系统环境:[sky@sky9896 ~]$ cat /etc/redhat-release Centos release 6.8 (Final)1.    登录数据库:[s

生产系统环境:

[sky@sky9896 ~]$ cat /etc/redhat-release

Centos release 6.8 (Final)

1.    登录数据库:

[sky@sky9896 ~]$ Mysql –uroot  -p

Enter passWord:

Welcome to the mysql monitor.  Commands end with ; or \g.

Your Mysql connection id is 151757

Server version: 5.5.49-cll-lve MySQL CommUnity Server (GPL) by Atomicorp

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>

2.    查看数据库版本当前登录用户是什么

mysql> select version();   #查看数据库版本

+----------------+

| version()      |

+----------------+

| 5.5.49-cll-lve |

+----------------+

1 row in set (0.00 sec)

mysql> select user(); #查看当前登录用户

+----------------+

| user()         |

+----------------+

| root@localhost |

+----------------+

1 row in set (0.02 sec)

3.创建GBK字符集的数据库skyboy,并查看已建库的完整语句。

mysql> create database skyboy character set gbk collate gbk_chinese_ci;

Query OK, 1 row affected (0.03 sec)

mysql> show databases;

+--------------------+

| Database           |

+--------------------+

| infORMation_schema |

| a                  |

| back20150625ultrax |

| cacti              |

| cacti20151220      |

| cacti20160104      |

| feifeicms          |

| mysql              |

| performance_schema |

| PHPcom             |

| skyboy             |

| study              |

| syslog             |

| test               |

| test1              |

| tt                 |

| ultrax             |

+--------------------+

17 rows in set (0.04 sec)

mysql> show create database skyboy\G   #查看已建库的完整语句

*************************** 1. row ***************************

       Database: skyboy

Create Database: CREATE DATABASE `skyboy`

1 row in set (0.00 sec)

4.创建用户skyboy,使之可以管理数据库skyboy。

mysql> grant all on skyboy.* to skyboy@'localhost' identified by '123456';

Query OK, 0 rows affected (0.09 sec)

5.查看创建的用户skyboy拥有哪引起权限。

mysql> show grants for skyboy@'localhost'\G

***************************1.row********************

Grants for skyboy@localhost: GRANT USAGE ON *.* TO 'skyboy'@'localhost' IDENTIFIED BY PASSWORD '*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9'

***************************2.row********************

Grants for skyboy@localhost: GRANT ALL PRIVILEGES ON `skyboy`.* TO 'skyboy'@'localhost'

2 rows in set (0.00 sec)

6.查看当前数据库里有哪些用户。

mysql> select user,host from mysql.user;

+-----------+-----------------+

| user      | host            |

+-----------+-----------------+

| cacti     | %               |

| cactiuser | %               |

| root      | %               |

| cacti     | *               |

| root      | *               |

| root      | 115.151.218.186 |

| cacti     | 117.40.239.9    |

| root      | 127.0.0.1       |

| root      | ::1             |

|           | localhost       |

| a1        | localhost       |

| a2        | localhost       |

| cactiuser | localhost       |

| root      | localhost       |

| sky9896   | localhost       |

| skyboy    | localhost       |

|           | sky9896         |

| root      | sky9896         |

+-----------+-----------------+

18 rows in set (0.00 sec)

7.进入skyboy数据库

mysql> use skyboy;

Database changed

mysql> select database();

+------------+

| database() |

+------------+

| skyboy     |

+------------+

1 row in set (0.00 sec)

8.创建一innodb引擎字符集为GBK表test,字段为id和name varchar(16),查看建表结构及SQL语句。

mysql> create table test(

    -> id int(4),

    -> name varchar(16)

    -> )ENGINE=innodb default charset=gbk;

Query OK, 0 rows affected (0.35 sec)

 mysql> show tables;

+------------------+

| Tables_in_skyboy |

+------------------+

| test             |

+------------------+

1 row in set (0.00 sec)

mysql> desc test;  #查看表结构,方法一

+-------+-------------+------+-----+---------+-------+

| Field | Type        | Null | Key | Default | Extra |

+-------+-------------+------+-----+---------+-------+

| id    | int(4)      | YES  |     | NULL    |       |

| name  | varchar(16) | YES  |     | NULL    |       |

+-------+-------------+------+-----+---------+-------+

2 rows in set (0.00 sec)

mysql> show columns from test;  #查看表结构,方法二

+-------+-------------+------+-----+---------+-------+

| Field | Type        | Null | Key | Default | Extra |

+-------+-------------+------+-----+---------+-------+

| id    | int(4)      | YES  |     | NULL    |       |

| name  | varchar(16) | YES  |     | NULL    |       |

+-------+-------------+------+-----+---------+-------+

2 rows in set (0.00 sec)

mysql> show create table test\G  #查看表结构

*************************** 1. row ***************************

       Table: test

Create Table: CREATE TABLE `test` (

  `id` int(4) DEFAULT NULL,

  `name` varchar(16) DEFAULT NULL

) ENGINE=InnoDB DEFAULT CHARSET=gbk

1 row in set (0.00 sec)

9.插入一条数据1,skyboy

mysql> insert into test values(1,'skyboy');

Query OK, 1 row affected (0.06 sec)

mysql> select * from  test;

+------+--------+

| id   | name   |

+------+--------+

|    1 | skyboy |

+------+--------+

1 row in set (0.00 sec)

10.批量插入数据2,坚持学MySQL,3,备考项管。要求中文不能乱码。

mysql>  insert into test values(2,'坚持学习MySQL'),(3,'参加项管考试');     #英文状态下的标点符号

Query OK, 2 rows affected (0.07 sec)

Records: 2  Duplicates: 0  Warnings: 0

 mysql> select * from test;

+------+--------------------+

| id   | name               |

+------+--------------------+

|    1 | skyboy             |

|    2 | 坚持学习MySQL      |

|    3 | 参加项管考试       |

+------+--------------------+

3 rows in set (0.00 sec)

11.查询插入的所有记录,查询名字为skyboy的记录。查询id大于1的记录。

mysql> select * from test;

+------+--------------------+

| id   | name               |

+------+--------------------+

|    1 | skyboy             |

|    2 | 坚持学习MySQL      |

|    3 | 参加项管考试       |

+------+--------------------+

3 rows in set (0.00 sec)

mysql> select * from test;  #查询插入的所有记录

+------+--------------------+

| id   | name               |

+------+--------------------+

|    1 | skyboy             |

|    2 | 坚持学习MySQL      |

|    3 | 参加项管考试       |

+------+--------------------+

3 rows in set (0.00 sec)

mysql> select * from test where name='skyboy';  #查询名字为skyboy的记录

+------+--------+

| id   | name   |

+------+--------+

|    1 | skyboy |

+------+--------+

1 row in set (0.00 sec)

mysql> select * from test where id>1;  #查询id大于1的记录 

+------+--------------------+

| id   | name               |

+------+--------------------+

|    2 | 坚持学习MySQL      |

|    3 | 参加项管考试       |

+------+--------------------+

2 rows in set (0.00 sec)

12.把数据id等于 1的名字skyboy更改为sky9890。

mysql> update test set name='sky9890' where  id=1;

Query OK, 1 row affected (0.05 sec)

Rows matched: 1  Changed: 1  Warnings: 0

mysql> select * from test;

+------+--------------------+

| id   | name               |

+------+--------------------+

|    1 | sky9890            |

|    2 | 坚持学习MySQL      |

|    3 | 参加项管考试       |

+------+--------------------+

3 rows in set (0.00 sec)

13.在字段name前插入age 字段,类型tinyint(2)。

mysql> alter table test add age tinyint(2)  after id;

Query OK, 3 rows affected (0.34 sec)

Records: 3  Duplicates: 0  Warnings: 0

mysql> desc test;

+-------+-------------+------+-----+---------+-------+

| Field | Type        | Null | Key | Default | Extra |

+-------+-------------+------+-----+---------+-------+

| id    | int(4)      | YES  |     | NULL    |       |

| age   | tinyint(2)  | YES  |     | NULL    |       |

| name  | varchar(16) | YES  |     | NULL    |       |

+-------+-------------+------+-----+---------+-------+

3 rows in set (0.00 sec)

14.备份skyboy库

root@sky9896 ~]#  mysqldump -uroot -p skyboy >/opt/bak.sql

Enter password:

[root@sky9896 ~]# ll /opt/bak.sql

-rw-r--r-- 1 root root 1923 8月  13 15:38 /opt/bak.sql

[root@sky9896 ~]# cat /opt/bak.sql

-- MySQL dump 10.13  Distrib 5.5.49, for linux (x86_64)

--

-- Host: localhost    Database: skyboy

-- ------------------------------------------------------

-- Server version       5.5.49-cll-lve

;

;

;

;

;

;

;

;

;

;

--

-- Table structure for table `test`

--

DROP TABLE IF EXISTS `test`;

;

;

CREATE TABLE `test` (

  `id` int(4) DEFAULT NULL,

  `age` tinyint(2) DEFAULT NULL,

  `name` varchar(16) DEFAULT NULL

) ENGINE=InnoDB DEFAULT CHARSET=gbk;

;

--

-- Dumping data for table `test`

--

LOCK TABLES `test` WRITE;

;

INSERT INTO `test` VALUES (1,NULL,'sky9890'),(2,NULL,'坚持学习MySQL'),(3,NULL,'参加项管考试');

;

UNLOCK TABLES;

;

;

;

;

;

;

;

;

-- Dump completed on 2016-08-13 15:38:31

15.删除表中的所有数据,并查看。

mysql> delete from test; #逻辑删除表中的数据,一列一列的删除表中数据,速度慢

Query OK, 3 rows affected (0.07 sec)

mysql> truncate table test; #物理删除表中的数据,一次性全部都给清空,速度很快

Query OK, 0 rows affected (0.07 sec)

mysql> select * from test;  #查看结果

Empty set (0.00 sec)

mysql> show tables;

+------------------+

| Tables_in_skyboy |

+------------------+

| test             |

+------------------+

1 row in set (0.00 sec)

 mysql> drop table test;

Query OK, 0 rows affected (0.07 sec)

 mysql> show tables;

Empty set (0.00 sec)

mysql> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| a                  |

| back20150625ultrax |

| cacti              |

| cacti20151220      |

| cacti20160104      |

| feifeicms          |

| mysql              |

| performance_schema |

| phpcom             |

| skyboy             |

| study              |

| syslog             |

| test               |

| test1              |

| tt                 |

| ultrax             |

+--------------------+

17 rows in set (0.00 sec)

mysql> drop database skyboy;

Query OK, 0 rows affected (0.04 sec)

 mysql> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| a                  |

| back20150625ultrax |

| cacti              |

| cacti20151220      |

| cacti20160104      |

| feifeicms          |

| mysql              |

| performance_schema |

| phpcom             |

| study              |

| syslog             |

| test               |

| test1              |

| tt                 |

| ultrax             |

+--------------------+

16 rows in set (0.00 sec)

17.Linux命令行恢复以上删除的数据

恢复的时候,要先建一个skyboy空数据,然后在恢复。

[root@sky9896 ~]# mysql -uroot -p skyboy</opt/bak.sql

Enter password:

mysql> use skyboy;

Database changed

mysql> show tables;

+------------------+

| Tables_in_skyboy |

+------------------+

| test             |

+------------------+

1 row in set (0.00 sec)

 mysql> select * from test;

+------+------+--------------------+

| id   | age  | name               |

+------+------+--------------------+

|    1 | NULL | sky9890            |

|    2 | NULL | 坚持学习MySQL      |

|    3 | NULL | 参加项管考试       |

+------+------+--------------------+

3 rows in set (0.00 sec)

18.把GBK字符集修改为UTF8。

mysql> show variables like  'character_set%';

+--------------------------+----------------------------+

| Variable_name            | Value                      |

+--------------------------+----------------------------+

| character_set_client     | utf8                       |

| character_set_connection | utf8                       |

| character_set_database   | latin1                     |

| character_set_filesystem | binary                     |

| character_set_results    | utf8                       |

| character_set_server     | latin1                     |

| character_set_system     | utf8                       |

| character_sets_dir       | /usr/share/mysql/charsets/ |

+--------------------------+----------------------------+

8 rows in set (0.00 sec)

mysql> set global character_set_database=gbk;

Query OK, 0 rows affected (0.00 sec)

mysql> exit

Bye

[root@sky9896 ~]# mysql -uroot -p

Enter password:

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 152566

Server version: 5.5.49-cll-lve MySQL Community Server (GPL) by Atomicorp

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> show variables like 'character_set%';   #数据库服务的字符集

+--------------------------+----------------------------+

| Variable_name            | Value                      |

+--------------------------+----------------------------+

| character_set_client     | utf8                       |

| character_set_connection | utf8                       |

| character_set_database   | gbk                        |

| character_set_filesystem | binary                     |

| character_set_results    | utf8                       |

| character_set_server     | latin1                     |

| character_set_system     | utf8                       |

| character_sets_dir       | /usr/share/mysql/charsets/ |

+--------------------------+----------------------------+

8 rows in set (0.00 sec)

19.修改mysql密码

mysql> update mysql.user set password=PASSWORD('skyboy') where user='root'

 and host='localhost'; 

Query OK, 1 row affected (0.00 sec) 

Rows matched: 1  Changed: 1  Warnings: 0 

mysql> flush privileges; 

Query OK, 0 rows affected (0.00 sec) 

20.MySQL内中文数据乱码的原理及如何防止乱码?(可选)。

#客户端软件字符集要用utf8

[root@sky9896 ~]# cat /etc/sysconfig/i18n   #修改字符配置文件                

 LANG="zh_CN.UTF-8"

21.在把id 列设置为主键,在Name字段上创建普通索引。

mysql> alter table skyboy.test add  primary key(id);

Query OK, 3 rows affected (0.32 sec)

Records: 3  Duplicates: 0  Warnings: 0

mysql> desc skyboy.test;

+-------+-------------+------+-----+---------+-------+

| Field | Type        | Null | Key | Default | Extra |

+-------+-------------+------+-----+---------+-------+

| id    | int(4)      | NO   | PRI | 0       |       |

| age   | tinyint(2)  | YES  |     | NULL    |       |

| name  | varchar(16) | YES  |     | NULL    |       |

+-------+-------------+------+-----+---------+-------+

3 rows in set (0.00 sec)

mysql> create index index_name on skyboy.test(name);

Query OK, 0 rows affected (0.23 sec)

Records: 0  Duplicates: 0  Warnings: 0

 mysql> desc skyboy.test;

+-------+-------------+------+-----+---------+-------+

| Field | Type        | Null | Key | Default | Extra |

+-------+-------------+------+-----+---------+-------+

| id    | int(4)      | NO   | PRI | 0       |       |

| age   | tinyint(2)  | YES  |     | NULL    |       |

| name  | varchar(16) | YES  | MUL | NULL    |       |

+-------+-------------+------+-----+---------+-------+

3 rows in set (0.00 sec)

22.在字段name后插入手机号字段(shouji),类型char(11)。

mysql> alter table skyboy.test add shouji char(11) after name;

Query OK, 3 rows affected (0.23 sec)

Records: 3  Duplicates: 0  Warnings: 0

mysql> desc skyboy.test;

+--------+-------------+------+-----+---------+-------+

| Field  | Type        | Null | Key | Default | Extra |

+--------+-------------+------+-----+---------+-------+

| id     | int(4)      | NO   | PRI | 0       |       |

| age    | tinyint(2)  | YES  |     | NULL    |       |

| name   | varchar(16) | YES  | MUL | NULL    |       |

| shouji | char(11)    | YES  |     | NULL    |       |

+--------+-------------+------+-----+---------+-------+

4 rows in set (0.00 sec)

23.所有字段上插入 2条记录(自行设定数据)

mysql> insert into test values(4,21,'sky','20160813'),(5,98,'skyboy','20160810');

Query OK, 2 rows affected (0.04 sec)

Records: 2  Duplicates: 0  Warnings: 0

mysql> select * from  test;

+----+------+-----------+----------+

| id | age  | name      | shouji   |

+----+------+-----------+----------+

|  1 | NULL | sky9890   | NULL     |

|  2 | NULL | ????MySQL | NULL     |

|  3 | NULL | ??????    | NULL     |

|  4 |   21 | sky       | 20160813 |

|  5 |   98 | skyboy    | 20160810 |

+----+------+-----------+----------+

5 rows in set (0.00 sec)

以上显示了乱码,解决方式如下:

[root@sky9896 ~]# vi /etc/sysconfig/i18n

LANG="zh_CN.UTF-8"

远程退出

重新登录才能生效

mysql> use skyboy;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

Database changed

mysql> select * from test;

+----+------+--------------------+----------+

| id | age  | name               | shouji   |

+----+------+--------------------+----------+

|  1 | NULL | sky9890            | NULL     |

|  2 | NULL | 坚持学习MySQL      | NULL     |

|  3 | NULL | 参加项管考试       | NULL     |

|  4 |   21 | sky                | 20160813 |

|  5 |   98 | skyboy             | 20160810 |

+----+------+--------------------+----------+

5 rows in set (0.00 sec)

24.在手机字段上对前 8个字符创建普通索引。

mysql> alter table test add index index_shouji(shouji(8));

Query OK, 0 rows affected (0.17 sec)

Records: 0  Duplicates: 0  Warnings: 0

mysql> desc test;

+--------+-------------+------+-----+---------+-------+

| Field  | Type        | Null | Key | Default | Extra |

+--------+-------------+------+-----+---------+-------+

| id     | int(4)      | NO   | PRI | 0       |       |

| age    | tinyint(2)  | YES  |     | NULL    |       |

| name   | varchar(16) | YES  | MUL | NULL    |       |

| shouji | char(11)    | YES  | MUL | NULL    |       |

+--------+-------------+------+-----+---------+-------+

4 rows in set (0.00 sec)

25.查看创建的索引及索引类型等信息。

mysql> show index from skyboy.test\G

*************************** 1. row ***************************

        Table: test

   Non_unique: 0

     Key_name: PRIMARY

 Seq_in_index: 1

  Column_name: id

    Collation: A

  Cardinality: 5

     Sub_part: NULL

       Packed: NULL

         Null:

   Index_type: BTREE

      Comment:

Index_comment:

*************************** 2. row ***************************

        Table: test

   Non_unique: 1

     Key_name: index_name

 Seq_in_index: 1

  Column_name: name

    Collation: A

  Cardinality: 5

     Sub_part: NULL

       Packed: NULL

         Null: YES

   Index_type: BTREE

      Comment:

Index_comment:

*************************** 3. row ***************************

        Table: test

   Non_unique: 1

     Key_name: index_shouji

 Seq_in_index: 1

  Column_name: shouji

    Collation: A

  Cardinality: 5

     Sub_part: 8

       Packed: NULL

         Null: YES

   Index_type: BTREE

      Comment:

Index_comment:

3 rows in set (0.01 sec)

26.删除Name,shouji列的索引。

mysql> alter table test drop index index_name;

Query OK, 0 rows affected (0.13 sec)

Records: 0  Duplicates: 0  Warnings: 0

mysql> drop index index_shouji on test;

Query OK, 0 rows affected (0.11 sec)

Records: 0  Duplicates: 0  Warnings: 0

mysql> show index from test\G;

*************************** 1. row ***************************

        Table: test

   Non_unique: 0

     Key_name: PRIMARY

 Seq_in_index: 1

  Column_name: id

    Collation: A

  Cardinality: 5

     Sub_part: NULL

       Packed: NULL

         Null:

   Index_type: BTREE

      Comment:

Index_comment:

1 row in set (0.00 sec)

27.对Name列的前6 个字符以及手机列的前8个字符组建联

索引

mysql> alter table test add index index_name_shouji(name(6),shouji(8));

Query OK, 0 rows affected (0.15 sec)

Records: 0  Duplicates: 0  Warnings: 0

mysql> show index from test\G

*************************** 1. row ***************************

        Table: test

   Non_unique: 0

     Key_name: PRIMARY

 Seq_in_index: 1

  Column_name: id

    Collation: A

  Cardinality: 5

     Sub_part: NULL

       Packed: NULL

         Null:

   Index_type: BTREE

      Comment:

Index_comment:

*************************** 2. row ***************************

        Table: test

   Non_unique: 1

     Key_name: index_name_shouji

 Seq_in_index: 1

  Column_name: name

    Collation: A

  Cardinality: 5

     Sub_part: 6

       Packed: NULL

         Null: YES

   Index_type: BTREE

      Comment:

Index_comment:

*************************** 3. row ***************************

        Table: test

   Non_unique: 1

     Key_name: index_name_shouji

 Seq_in_index: 2

  Column_name: shouji

    Collation: A

  Cardinality: 5

     Sub_part: 8

       Packed: NULL

         Null: YES

   Index_type: BTREE

      Comment:

Index_comment:

3 rows in set (0.00 sec)

28.查询手机号以159开头的,名字为skybboy的记录。

mysql> select * from test where name='skyboy' and shouji like '159%';

+----+------+--------+-------------+

| id | age  | name   | shouji      |

+----+------+--------+-------------+

|  5 |   98 | skyboy | 15907999899 |

+----+------+--------+-------------+

1 row in set (0.00 sec)

29.查询上述语句的执行计划(是否使用联合索引等)。

mysql> explain select * from test where  name='skyboy' and shouji like '159%';

+----+-------------+-------+-------+-------------------+-------------------+---------+------+------+-------------+

| id | select_type | table | type  | possible_keys     | key               | key_len | ref  | rows | Extra       |

+----+-------------+-------+-------+-------------------+-------------------+---------+------+------+-------------+

|  1 | SIMPLE      | test  | range | index_name_shouji | index_name_shouji | 32      | NULL |    1 | Using where |

+----+-------------+-------+-------+-------------------+-------------------+---------+------+------+-------------+

1 row in set (0.00 sec)

mysql> explain select * from  test where name='skyboy' and shouji like '159%'\G

*************************** 1. row ***************************

           id: 1

  select_type: SIMPLE

        table: test

         type: range

possible_keys: index_name_shouji

          key: index_name_shouji

      key_len: 32

          ref: NULL

         rows: 1

        Extra: Using where

1 row in set (0.00 sec)

30.把test表的引擎改成MyISAM。

MySQL 数据库 5.1 版本以前默认的引擎是 MyISAM

MySQL 数据库 5.5 版本以后默认的引擎都是 InnoDB

mysql> show create table test\G   #查看test表引擎

*************************** 1. row ***************************

       Table: test

Create Table: CREATE TABLE `test` (

  `id` int(4) NOT NULL DEFAULT '0',

  `age` tinyint(2) DEFAULT NULL,

  `name` varchar(16) DEFAULT NULL,

  `shouji` char(11) DEFAULT NULL,

  PRIMARY KEY (`id`),

  KEY `index_name_shouji` (`name`(6),`shouji`(8))

) ENGINE=InnoDB DEFAULT CHARSET=gbk

1 row in set (0.00 sec)

mysql> alter table test ENGINE=MyISAM; #修改默认引擎

Query OK, 5 rows affected (0.14 sec)

Records: 5  Duplicates: 0  Warnings: 0

mysql> show create table test\G

*************************** 1. row ***************************

       Table: test

Create Table: CREATE TABLE `test` (

  `id` int(4) NOT NULL DEFAULT '0',

  `age` tinyint(2) DEFAULT NULL,

  `name` varchar(16) DEFAULT NULL,

  `shouji` char(11) DEFAULT NULL,

  PRIMARY KEY (`id`),

  KEY `index_name_shouji` (`name`(6),`shouji`(8))

) ENGINE=MyISAM DEFAULT CHARSET=gbk

1 row in set (0.00 sec)

您可能感兴趣的文档:

--结束END--

本文标题: Linux+MySQL运维的基础命令

本文链接: https://www.lsjlt.com/news/42111.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • Linux+MySQL运维的基础命令
    生产系统环境:[sky@sky9896 ~]$ cat /etc/redhat-release CentOS release 6.8 (Final)1.    登录数据库:[s...
    99+
    2022-10-18
  • openstack 基础运维命令
    以下是一些基础的OpenStack运维命令:1. 登录到OpenStack控制节点:$ ssh @2. 列出所有的OpenStack...
    99+
    2023-10-11
    openstack
  • Linux基础命令---mysql
    mysqlmysql是一个简单的sql shell,它可以用来管理mysql数据库。此命令的适用范围:RedHat、RHEL、Ubuntu、CentOS、Fedora。 1、语法mysql [options] ...
    99+
    2023-06-05
  • MySQL基本运维命令详解
    目录1. 导出test_db数据库2. 导出一个表3. 导出一个数据库结构4. 导入数据库5. mysql进入与退出6. 数据库操作7. 数据表操作8. 修改密码9. 增加用户10. 删除用户11. 数据库授权12. 锁...
    99+
    2023-01-15
    MySQL运维命令 MySQL基本运维命令 MySQL运维
  • mysql 运维命令
    数据库备份导入 mysqldump -u root -p main_3_2_0 > /main_3_2_0.sql use main_3_2_0 source /main_3_2_0.sql   #查询正在执行的sql sh...
    99+
    2017-01-20
    mysql 运维命令
  • Linux基础命令---more
    more将内容较长的文本文件内容分屏显示,支持定位关键字。此命令的适用范围:RedHat、RHEL、Ubuntu、CentOS、SUSE、openSUSE、Fedora。 1、语法more [-dlfpcsu] ...
    99+
    2023-06-05
  • Linux基础命令---head
    head显示文件开头的几行,默认显示10行,可以使用选项-n来指定行数。此命令的适用范围:RedHat、RHEL、Ubuntu、CentOS、SUSE、openSUSE、Fedora。1、语法head [选项] &nbs...
    99+
    2023-06-06
  • Linux基础命令---gunzip
    gunzip解压缩被gzip压缩过的文件。此命令的适用范围:RedHat、RHEL、Ubuntu、CentOS、SUSE、openSUSE、Fedora。1、语法gunzip [-acfhlLnNrtvV]  ...
    99+
    2023-06-05
  • Linux基础命令---bzcat
    bzcat解压缩被bzip2压缩过的文件,将文件解压到标准输出,此命令只有一个选项-s。该指令对压缩过的二进制文件没有意义,因为二进制文件没有可读性。此命令的适用范围:RedHat、RHEL、Ubuntu、CentOS、SUSE、openS...
    99+
    2023-06-05
  • Linux基础命令---zcat
    zcat解压有gzip压缩的文件,将解压结果送到标准输出。此命令的适用范围:RedHat、RHEL、Ubuntu、CentOS、SUSE、openSUSE、Fedora。1、语法zcat [-fhVL] 文件 ...
    99+
    2023-06-05
  • Linux基础命令---bunzip2
    bunzip2解压缩bzip2压缩过的文件。此命令的适用范围:RedHat、RHEL、Ubuntu、CentOS、SUSE、openSUSE、Fedora。1、语法bunzip2 [-fkvsVL]  文件&n...
    99+
    2023-06-06
  • Linux基础命令---zip
    zipzip是一种最通用的文件压缩方式,使用于unix、msdos、windows、OS等系统。如果在编译zip时包含bzip 2库,zip现在也支持bzip 2压缩。当将大于4GB的文件添加到存档中时,zip会自动使用Zip 64扩展名,...
    99+
    2023-06-06
  • Linux基础命令---gzexe
    gzexe压缩可执行文件,在执行程序的时候可以自动实现解压。此命令的适用范围:RedHat、RHEL、Ubuntu、CentOS、SUSE、openSUSE、Fedora。1、语法gzexe file 2、选项列表选项说...
    99+
    2023-06-06
  • Linux基础命令- history
    Linux基础命令- history 1.history 显示历史命令 作用:用于显示历史记录和执行过的指令命令 当登录shell或者是退出的时候会自动进行读取和存储 1.常用参数 语法:# history 选项 参数#参数-n ...
    99+
    2023-08-22
    linux 运维 服务器
  • Linux基础命令---apachectl
    apachectlapachectl指令是apache http服务器的前端控制程序,可以协助控制apache服务的守护进程httpd。此命令的适用范围:RedHat、RHEL、Ubuntu、CentOS、SUSE、openSUSE、Fed...
    99+
    2023-06-05
  • linux命令基础(3)
    find是最常见和最强大的查找命令,你可以用它找到任何你想找的文件。find的使用格式如下:find <指定目录> <指定条件> <指定动作>- <指定目录>: 所要搜索的目录及其所有子目录。...
    99+
    2023-01-31
    命令 基础 linux
  • Linux基础命令---find
    file判断指定文件的文件类型,它依据文件内容判断,并不依据扩展名。此命令的适用范围:RedHat、RHEL、Ubuntu、CentOS、SUSE、openSUSE、Fedora。1、语法file [选项]  ...
    99+
    2023-06-06
  • Linux基础命令---comm
    comm逐行比较两个已经排序过的文件。结果以3列显示:第1列显示只在file1出现的内容,第2列显示只在file2出现的内容,第3列显示同时出现的内容。此命令的适用范围:RedHat、RHEL、Ubuntu、CentOS、SUSE、open...
    99+
    2023-06-06
  • Linux基础命令---ls
    ls显示当前目录下的所有内容。此命令的适用范围:RedHat、RHEL、Ubuntu、CentOS、SUSE、openSUSE、Fedora。 1、语法ls [OPTION]... [FILE]... 2、选项...
    99+
    2023-06-06
  • Linux基础命令---chgrp
    chgrp改变文件或者目录所属的群组,使用参数“--reference”,可以改变文件的群组为指定的关联文件群组。此命令的适用范围:RedHat、RHEL、Ubuntu、CentOS、SUSE、openSUSE、Fedora。 1...
    99+
    2023-06-06
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作