Home >Database >Mysql Tutorial >How can we build a MySQL database using MySQL binaries from the command prompt?
You can create a MySQL database using the mysql binary file at the command prompt. It can be understood through the following example -
We can connect to the MySQL server from the command prompt using the following statements-
[root@host]# mysql -u root -p Enter password:******
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.
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
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!