How to install MySql and create a database on Linux Ubuntu

Hello everyone, this article provides information about how to install MySql into Linux Ubuntu operating system. In addition, here will be information on what such a useful program, like MySql, represents to the end users. We will review it's main features and functions.

First, we want to explain what is MySql. When we say MySql, we mean relational system that enables easy database management. It can be used for small and medium-sized applications. Oracle company has developed this corporate system. They are still involved in its ongoing support. You can use this database management system as a local server which is accessed by remote users, or as an internal library server. The latest version of MySql is 5.6.

Now, after reading first part of the article, you may proceed with the installation of MySql on your Linux operating system. You can do this in two ways. The first one is by using system package manager, the second - by typing commands console.

In our guide, we are going to explain only the first option. To do this, please start your Linux Ubuntu operating system. Then, Push Applications item on the top panel and select Ubuntu Software Center menu item. Enter MySql text into the window right to to search bar and select what you were looking for, namely - MySql Server. If you want to make sure that you have selected the correct program, please click on the More info button and read the information provided by the creator. Next, start the installation process by clicking on the Install button. It's possible that the password authentication request may be shown to install software package, since such process requires certain privileges. And, after these steps, you should patiently wait until the MySql Server database management system will be installed.

Ubuntu software

During installation, you are going to be prompted to enter the password that you will use to access your database. And, you just need to enter it again for clarification, when such is requested.

After the database system installation, you need to start it. To do this, please go to the console and enter mysql command. Immediately after this action, you must enter your username. In case of our example, it will bel root. Then you have to type the password that were entered by you during MySQL installation.

As you understand, that's the way we run MySql Server. Then you can see an example of what is displayed on the screen of our console.

dev@ubuntu:~$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 40
Server version: 5.1.54-1ubuntu4 (Ubuntu)
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>

Then, if needed, we can proceed with the database creation itself. Please write Create database command with database name in your console. An important thing to note is that you need to put a semicolon at the end of each request.

mysql> create database Test;
Query OK, 1 row affected (0.02 sec)

In addition, for example, you can create employee table with such fields: ID (type - integer), Name (type - text) and Position (type - text). To do this, select previously created database and create a table called Tbtest by using Create table query.


mysql> use Test;
Database changed
mysql> create table Tbtest (number int, name text, position text);
Query OK, 0 rows affected (0.04 sec)
Сonsole

In this article you have learned how to install MySql management system and how to create simplest database that can contain a table with some fields. In the near future, we will show more possibilities of the MySql package in our articles. Stay tuned with us and wait for the new articles about information technologies!

Best regards, DYAMAR Engineering.

Language: 
Category: 
Platform: 

All rights reserved. You may not copy or distribute, electronically or otherwise, any part of this article for any purpose without prior written permission from the DYAMAR Engineering.