ComputersDatabase

How to create a mysql database

It is not so important, because of what you are interested in the question of how to create a mysql database , it is much more important if you have a basic set of knowledge, without which it is not necessary to talk about the successful implementation of the conceived.

In this article I will tell you what actions should be taken by any PC owner if for some purpose he had to install mysql, create a database, and try his hand at managing a modern database. It will also be of interest to those who want to know how to make modern DBMS work.

Since, as I said, in order for you to succeed, you need basic knowledge, without which you will not be able to create the mysql database, so we will assume that you know what a database, table, queries to the database are and does not put you in the database. Deadlock SQL abbreviation. Also, we assume that you have an Apache server installed and configured.

So, if everything you need is available, and the desire to learn how to create a mysql database has not been lost, we'll start by starting Apache. To start it, go through the path C: \ WebServers \ etc and run the file Run. If Apache is correct, it starts up without errors, then in the lower right corner to the existing icons will be added a red pen.

Now you need to make sure that the webserver is working, enter the address in the browser http: // localhost / In response you should get the text "Hurray, earned!", If it is you see it on the monitor, then Apache is full order.

Now go to Utilities and select phpMyAdmin from the list, you have a graphical shell that allows you to manage mySQL. With its help, it is possible to perform all operations, without exception, that are provided by the creators of this database, and specifically:

Database creation

In order to create a database, in the field "Create a new database" you must enter a name, for example, MyBase. Now we press the button "Create", and phpMyAdmin will create a new database.

Creating tables

To create tables is easy enough, you should select the database (MyBase). In the main window, you are prompted to enter a name for the table (try entering the name DataStudent), and also enter the number of fields (put the number 5). When choosing how many fields you will have, do not forget that one field goes under the key (ID). If you have entered everything correctly, then press the "Enter" button.

Now you will see an additional form of creating tables. In it, you can specify fields, assign data types for each of them, name the columns, determine their maximum sizes. Typically, the first field is the key. We enter the name "ID" into it, now we need to determine the type of data that will be entered for this column. Since in MySQL of the type, as the counter, does not exist, you should choose Int, in the attributes put a tick unsigned. Then go to the advanced settings and put Auto-increment there, so that each time a new value is entered, this field increments its value by itself.

So you have a typical counter. It's time to move to the next group of settings - RadioButton. Here we select the value "primary", if it is activated - then our field becomes the primary key.

If you did everything correctly, then the main field is configured correctly, when you add rows in it, the ID value automatically increases. And you are one step closer to understanding how to create a MySQL database.

Moving on, now we need to define the values and give the names to the rest of the columns of our table. Let it be information fields. Surname, name, patronymic and, for example, "Fam", "Name", "Otch", "Ocenka", it remains to assign a data type - varChar, because these fields will store information in the form of a string. Do not forget to set the maximum length of the fields, it will be logical to limit it to a value of 30 characters. Check all entered data and admire the table you created. It should have a set of fields with the names "ID", "Fam", "Name", "Otch", "Ocenka".

I hope that the information in this article was useful to you, and you found the answer to the question on how to create a MySQL database.

Similar articles

 

 

 

 

Trending Now

 

 

 

 

Newest

Copyright © 2018 en.atomiyme.com. Theme powered by WordPress.