如何在命令提示符下使用MySQL二进制文件建立MySQL数据库?
您可以在命令提示符下使用 mysql 二进制文件建立MySQL数据库。通过以下示例可以理解-
示例
我们可以使用以下语句从命令提示符连接到MySQL服务器-
[root@host]# mysql -u root -p Enter password:******
这将为我们提供mysql>命令提示符,在这里我们将能够执行任何SQL命令。以下是上述命令的结果-
以下代码块显示了以上代码的结果-
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.7.20 MySQL Community Server (GPL) Copyright (c) 2000, 2017, 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.
在上面的示例中,我们以root用户身份使用,但您也可以使用任何其他用户。任何用户都将能够执行该用户允许的所有SQL操作。
我们可以随时在mysql>提示符下使用exit 命令从MySQL数据库断开连接。
mysql> exit Bye
热门推荐
1 聚餐会祝福语简短
10 三八简短祝福语给婆婆
11 新疆新年祝福语大全简短
12 国庆中秋祝福语简短搞笑
13 今日祝福语简短10字
14 喜事敬酒祝福语简短精辟
15 送给老师中秋祝福语简短
16 官宣新年祝福语简短
17 异性朋友简短生日祝福语
18 对疫情的简短祝福语