How to create a database in MySQL step by step?

Learn to how to create a database in MySQL , something widely used right now by web pages to save your record and information on your server, learn about all this in this article through truthful and good quality information.

how-to-create-a-database-in-myqsl-2.

How to create a database step by step

How to create a database in MySQL?

Currently, anyone who wants to record their work or data, uses this type of server to have a reliable and secure database. However, not everyone knows how to do it and they get blocked, more with our tutorial, you will know step by step how to create a database with different platforms.

How to create a database using Linux?

  1. In other ways to create the database, use Linux as the medium is one of the easiest. You must enter MySQL and use the console.
  2. In the console, we must enter as root, that is, as administrator. The root should not be the same as the database user, because it can lead to scripting problems.
  3. First put "create database db_name". This will be the actual name of the database and will help to create it.
  4. The user associated with the database is placed: "create database db_name" * to "user" "@"
  5. Then, the "localhost" is placed, that is, the current location of your server or another ip: "create database db_name" * to "user" "@" "localhost"
  6. The password of the database user is placed, it is recommended to use passwords that are difficult to hack, since your private data will be stored here: «» create database db_name «* to» user «» @ «» localhost «IDENTIFIED BY» password ".

How to create a database using cPanel?

CPanel is a tool for managing web data warehouse servers, granting authorization and uses automation to send data or give permissions to the database. Use software that allows you to easily manage a database, without so many problems; MySQL is one of the servers that cPanel handles, here we will show you how to create the database through the platform, without having to use the MySQL control panel:

  1. First you have to enter cPanel and look for the tool's menu.
  2. In the menu, there should be an entry that says "Database". When opening, there should be several database options, you have to look for the one that says "MySQL Databases".
  3. Now, we will be in an interface that will allow us to edit, delete or create our database at will.
  4. We press that option and they will enter the name that they like best or is best associated for their database.
  5. A window will appear that will have the name that was placed on the database, which will ask a cPanel user, enter the name they want. Finally, check the "create" option.
  6. After creating the database, it will ask for a MySQL username, since they will confirm if we have something related to the platform. Enter the username and voila, you will have your database connected to the cPanel interface.

If you do not have a user in MySQL, do not be alarmed, we will explain step by step how to create a user, so that you can have your database.

how to create a database in mysql

CPanel platform interface

How to create a user in MySQL?

  1. We enter cPanel again and look in its menu for the "Database" option.
  2. Already inside the option, we will look for among the several alternatives that there is the one that says: «MySQL users», we will enter there.
  3. Already in the option, it will allow us to create a user and create a password. It is recommended that the password be of a high level, because the idea is to protect it from any type of threat.
  4. After entering the username and password of our preference, we will reconfirm the password and click on "create user".

You already have the username for your database and your database key, to create and use it to your liking. However, not everything is complete, now you must assign values ​​in a preferential way so that their interaction with the database is in the most comfortable way.

How to add privileges to the MySQL user?
  1. We go to the cPanel menu and look again for the "Databases" option.
  2. We will look for the option that says «Add user to the Database». The option is used to give the user privileges when managing the database.
  3. We enter our created user, which is the database administrator, in order to give him the privilege.
  4. After having entered the user, the name of the database is entered and, finally, we add both.
  5. Once the add step is completed, an option will appear that will allow us to manage everything that the user can use in the database; "Manage user privileges" is the option. The user and the database are indicated again.
  6. The options or privilege controls that the user can have, already depend on us and the work that the user has in the database. We recommend choosing the "all privileges" option, so that in this way the user can manage the database as desired or manage the database in the best possible way.
  7. To finalize everything that has been done, choose the option "Make changes" and everything will be done, you can work on the database when you can and as you wish.
How to see which users are assigned to the databases?

You may have several people working on the same database and you want to know who does something with the database, we will explain what to do to be aware. The first thing is to go to the platform menu and look for the option "Current databases".

Current databases will allow you to see who is in the database, you can edit or delete it if you want, whatever you think is necessary.

How to create a DB by means of phpMyadmin?

PhpMyadmin, is a good option to manage MySQL, in order to manage the database virtually. It uses a PHP language, in order to have a more pleasant handling of the database, all in a virtual way and with the aim of only handling MySQL.

We will explain step by step how to create your database in MySQL, quickly and easily, on the phpMyadmin platform:

  1. Enter the phpMyadmin platform and look for the options menu. It will look for the option "Databases" in the interface.
  2. After pressing the databases option, it will look for the option "Create databases", which will show blank spaces to fill in with the data. The data that it asks for is the name that we want to place in the database.
  3. After this we will give the option "Collation", which is to confirm the site or page of the database. We end up giving it a «Create» to confirm everything.
  4. After creating the database we must add the user who will manage the database, for this, we enter the databases option and we will look for the "user" option. In the user option, we will add a user and several blank spaces will have to be answered.
  5. We will write the name of the user, which will be the one that manages our data warehouse server, in addition, we will assign the privileges that the user wants to need to manage the database. It will be accepted by hitting "Apply", which will be created by the user and will be anchored to the base.
  6. Now, we will edit the privileges that we want the user to have. The user will be searched for and the option «Edit privileges» will be pressed to display the privileges.
  7. After pressing this option, another option will appear that will say "Specific privileges of the database", where we will link everything related to the database with the user. We complete the entire process using the "Apply" option.

How to create a MySQL DB in Windows?

Windows is one of the largest operating systems in the world, which is used by companies and users. We will teach you how to create a MySQL database on Windows.

  1. Enter the Windows page and look for the Windows Hosting option. It will look for the option that says "MySQL Database" and click.
  2. It gives you the option to "Create a database" and writes the name of the database, in addition, it will fill in the fields that are requested. When everything is complete, click OK to create the database.
  3. The option to create a user will appear, click on it and put the name that you like the most in your password, the password must be of a high level to protect the server and the information. It gives you the permissions it deems necessary to manage the database.
  4. After verifying the database and the user, you will accept and save the changes. You will already have your database and you can upload everything you want from your favorite operating system.

What is MySQL?

We have already explained how to create a database in this information store, however, you may not know what MySQL is or what it is for. MySQL is a platform for storing information in large quantities online, all formed in a database.

MySQL is one of the most used platforms in the world to store data, therefore, it was bought and used by Oracle, a platform for storing data in the cloud, in this way it offers paid and free options to the public, in order to have a data server connected to your cloud.

The MySQL database is compatible with different platforms and websites, which can connect with them and save as much information as possible about the data or files made in those applications. Cross-platforms and languages ​​such as PHP or PHP-FPM can be used.

It is a secure system, without any flaws and is used by large companies, since they want to save their data and information from third parties, in addition to protecting them from possible cyber attacks.

If you liked the article, I invite you to read about: » Sequential structures What are they and what are they for? » , an article that explains the instructions followed in sequence and its relationship with the world of programming. I know you are going to enjoy it.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Actualidad Blog
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.