• mysql常用操作


    -- 查看当前数据库

    mysql> SELECT DATABASE();
    +------------+
    | DATABASE() |
    +------------+
    | mydb       |
    +------------+
    1 row in set (0.00 sec)

    -- 显示当前时间、用户名、数据库版本

    mysql> SELECT now(), user(), version();
    +---------------------+----------------+-----------+
    | now()               | user()         | version() |
    +---------------------+----------------+-----------+
    | 2019-01-03 15:54:47 | root@localhost | 5.7.24    |
    +---------------------+----------------+-----------+
    1 row in set (0.00 sec)

    -- 查看已有库

    mysql> SHOW DATABASES;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | mydb               |
    | mysql              |
    | performance_schema |
    | sys                |
    +--------------------+
    5 rows in set (0.00 sec)

    -- 查看当前库信息

    mysql> SHOW CREATE DATABASE mydb;
    +----------+-----------------------------------------------------------------+
    | Database | Create Database                                                 |
    +----------+-----------------------------------------------------------------+
    | mydb     | CREATE DATABASE `mydb` /*!40100 DEFAULT CHARACTER SET latin1 */ |
    +----------+-----------------------------------------------------------------+
    1 row in set (0.00 sec)

    -- 删除库

    mysql> drop database mytest;
    Query OK, 0 rows affected (0.00 sec)

     启动方式一:

    mysqld_safe --secure-file-priv= --user=mysql &

    启动方式二:

    /etc/init.d/mysqld start
    /etc/init.d/mysqld stop

    启动方式三:

    service mysqld start
    service mysqld stop

  • 相关阅读:
    关于编码的两个小点(摘)
    c#中类和成员的修饰符介绍
    jquery/js不支持ie9以下版本的方法或属性
    一次Linux系统被攻击的分析过程
    运维堡垒机(跳板机)系统 python
    puppet 3+Unicorn+Nginx安装配置
    用memcache来同步session
    php+memcache实现的网站在线人数统计
    CentOS yum 源的配置与使用
    Bind+DLZ构建企业智能DNS/DNS
  • 原文地址:https://www.cnblogs.com/hello-wei/p/10214941.html
Copyright © 2020-2023  润新知