马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
作为开发职员你不须要做复杂的mysql server的各种维护操纵, 只是想在本机或捏造机做个server,然后整测试性数据库. 下面我给出最最简朴的根本操纵:
Ubuntu安装完mysql server, 而且后,可以做如下根本操纵,就表现可以了
你可以在这个根本的情况下,做数据库方面的操纵,完成你的任务,
$ sudo mysql #////默认的root socket方式登录
假如出了: mysql>
就表现登录数据库乐成, 进入mysql>交互情况
按ctl+d按键就退出这个情况
下面是我在Ubuntu 24.04下操纵的结果
~$ sudo mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 21
Server version: 8.0.40-0ubuntu0.24.04.1 (Ubuntu)
Copyright (c) 2000, 2024, Oracle and/or its affiliates.
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>
下面这几个下令都是在mysql>情况下操纵的, 这个情况的输入的都是所谓的通用尺度
的sql下令, 操纵字(mysql 下令关键字)部门不分巨细写(按尺度保举大写)
show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec)
表现了刚装完数据库后的默认带的这四个根本数据库,它们的作用是处于管理职位, 用于
设置/查询在mysql server自己的默认的属性等等,
use mysql;
show tables;
...
5. 创建/删除/操纵数据库
DROP DATABASE zzblog;
CREATE DATABASE zzTest_db;
|