使用mysql连接工具

    技术2022-07-11  90

    使用mysql连接工具 2.1 问题 使用mysql命令工具连接本机的MariaDB数据库服务器,完成下列任务:

    1)以管理用户root登入

    2)列出有哪些库

    3)退出MariaDB>交互界面,返回Linux命令行

    2.2 步骤 实现此案例需要按照如下步骤进行。

    步骤一:以管理用户root登入

    [root@svr7 ~]# mysql -uroot -ppwd@123 Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 10 Server version: 5.5.56-MariaDB MariaDB Server Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> //交互式管理界面

    步骤二:列出有哪些库

    MariaDB [(none)]> SHOW DATABASES; //列出有哪些库 +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | test | | zabbix | +--------------------+ 5 rows in set (0.00 sec) MariaDB [(none)]> 步骤三:退出MariaDB>交互界面,返回Linux命令行 MariaDB [(none)]> QUIT; //退出管理 Bye [root@svr7 ~]# //已返回命令行
    Processed: 0.013, SQL: 9