CentOS6中的mysql及基本用法

mysql数据库摘要

CentOS6中的mysql及基本用法

1、查看mysql-server包信息

[root@CentOS6 ~]#yum info mysql-server

1528180146(1)

2、安装mysql-server包

[root@CentOS6 ~]#yum install mysql-server

1

注意:安装mysql-server包的时候系统自动帮我们安装了客户端包mysql。

3、客户端登陆mysql

[root@CentOS6 ~]#mysql

CentOS6中的mysql及基本用法0

出现上图所示,表示已经登陆到mysql数据库,可以开始正常的增删改查操作了!

4、mysql数据库的使用

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.1.73 Source distribution

Copyright (c) 2000, 2013, 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> help     //根据系统提示输入help或者是\h之后会显示mysql的操作快捷键

mysql> show databases;     //查看当前数据库中所有的数据库列表

3

mysql> system hostname ;\!  ls     //在mysql数据库中执行linux系统命令。前面加system或者\! 

4

mysql> status     //查看当前数据库的状态信息

5

mysql> use  mysql;     //进入mysql数据库

6

mysql> use  mysql;     //进入mysql数据库

6

mysql> show  tables;     //查看mysql数据库的文件内容

7

mysql> select user,host,password  from  user;     //查看mysql数据库中user表中的用户,主机,密码三项内容

8

本文来自投稿,不代表Linux运维部落立场,如若转载,请注明出处:http://www.178linux.com/100427

(6)
JllbcJllbc
上一篇 2018-06-05 15:29
下一篇 2018-06-05 18:33

相关推荐

  • 文本处理工具、用户及权限管理

    ##### 命令tr “`选项:-c 取字符补集-d 删除字符-s 把连续重复的字符以单独一个字符表示-t 将第一个字符集对应字符转化为第二字符集对应的字符例:[root@centos6 ~]#tr ‘a-f’ ‘A-Z’abcdefghABCDEFghtr 与tr -t 的区别[root@cent…

    2018-04-08
  • linux基础

    linux基础命令

    2018-04-08
  • linux基础知识

    本博文写的是linux的基础知识,比较杂,但是都很重要。

    Linux笔记 2018-07-22
  • 1

    1

    Linux笔记 2018-05-26
  • 随堂笔记2

    记马哥Linux运维课程第二周知识点(持续更新中)   bin目录 存放二进制数据 给普通用户执行的 在Centos7上 绿色的为… 并不是真正的文件夹 而是快捷方式 bin->usr/bin 内容放在一起 ;在6上,这两者并不是同一个目录,分开放 sbin 给管理员执行的二进制程序 media mnt(mount) 充当外围设备…

    Linux笔记 2018-07-29
  • 初学Linux之标准I/O和管道

    标准输入和输出 程序是由指令+数据组成程序的数据流有三种: 输入数据流:<–标准输入(stdin),一般默认是键盘输出数据流:–>标准输出(stdout),一般默认到终端窗口错误输出流:–>标准错误(stderr),一般默认到终端窗口 标准输入:0标准输出:1错误输出:2 I/O重定向:改变默认位置 输出…

    Linux笔记 2018-04-03