Home > Database > Mysql Tutorial > How can we build a MySQL database using MySQL binaries from the command prompt?

How can we build a MySQL database using MySQL binaries from the command prompt?

王林
Release: 2023-09-10 17:13:02
forward
996 people have browsed it

我们如何在命令提示符下使用 MySQL 二进制文件来建立 MySQL 数据库?

You can create a MySQL database using the mysql binary file at the command prompt. It can be understood through the following example -

Example

We can connect to the MySQL server from the command prompt using the following statements-

[root@host]# mysql -u root -p
Enter password:******
Copy after login

This will give us mysql> command prompt symbol where we can execute any SQL command. Below is the result of the above command -

The following code block shows the result of the above code -

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.
Copy after login

In the above example we are using root as the user but you Any other user can also be used. Any user can perform all SQL operations allowed for that user.

We can use the exit command at the mysql> prompt at any time to disconnect from the MySQL database.

mysql> exit
Bye
Copy after login

The above is the detailed content of How can we build a MySQL database using MySQL binaries from the command prompt?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template