In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article is to share with you about the steps of building a database in mysql. The editor thought it was very practical, so I shared it with you as a reference. Let's follow the editor and have a look.
How does mysql set up the database?
Mysql can create a database in three ways:
1. Create a database using the create command
After logging in to the MySQL service, we can use the create command to create the database. The syntax is as follows:
CREATE DATABASE database name
The following command simply demonstrates the process of creating a database, named DEMO:
[root@host] # mysql-u root-p Enter password:* # log in to terminal mysql > create DATABASE DEMO
two。 Create a database using mysqladmin
With normal users, you may need specific permissions to create or delete MySQL databases.
So we use the root user to log in, and the root user has the highest privileges, so we can use the mysql mysqladmin command to create the database.
The following command simply demonstrates the process of creating a database, named DEMO:
[root@host] # mysqladmin-u root-p create DEMO Enter password:*
The MySQL database DEMO is created after the above command is executed successfully.
3. Create a database using a PHP script
PHP uses the mysqli_query function to create or delete an MySQL database.
This function takes two arguments and returns TRUE on successful execution, or FALSE otherwise.
Grammar
Mysqli_query (connection,query,resultmode): thank you for reading! On the mysql database steps to share here, I hope that the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it and let more people see it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.