How To Install Database In Linux
MySQL is the most famous open-source and freely available database management software system. It is quick, reliable, flexible, and easy to use the database, it works with LEMP and LAMP stacks. At that place are two different packages of MySQL, each for a specific purpose. MySQL Client package which works on the customer-side to connect to servers and MySQL Server package, that works in your organization to fix up and host your databases. In this tutorial, I will show you lot how to install these two packages and gear up the MySQL server in a few easy steps.
How to install MySQL customer DBMS on Ubuntu:
MySQL clients enable yous to run MySQL shell command to connect to MySQL server databases remotely.
Footstep one:
As ever, first, update and upgrade your APT.
Pace two:
Now download and install MySQL client with the following terminal command.
$ sudo apt install mysql-client.
Step 3:
Now to cheque whether the MySQL client is installed or non, blazon the following command to see its version.
Step iv:
Now you can connect to MySQL server remotely through the given command.
$ mysql -u USERNAME -p PASSWORD -h HOSTNAME_OR_IP
Enter the right username, password, and server hostname or IP address to connect to the server.
How to install MySQL Server DBMS on Ubuntu:
Yous tin can host 1 or many MySQL databases on your local car with the assist or MySQL server package.
Stride 1:
Equally always, first, update and upgrade your APT.
Step 2:
Now download and install the MySQL server package via the command.
$ sudo apt install mysql-server
Step 3:
MySQL server package comes with a unique feature chosen MySQL-Secure-Installation. You take to install it to secure your MySQL server packet. Execute the below command to secure your MySQL server from unauthorized root logins locally and remotely.
$ sudo mysql_secure_installation
Step 4:
When MySQL server installs, it is accessible from a local machine but. You tin alter this setting in the MySQL configuration file to allow remote access. Enter the post-obit command to open up MySQL configuration file in gedit or any other text editor.
$ sudo gedit /etc/mysql/mysql.conf.d/mysqld.cnf
Change the following IP, save the file, and shut it.
bind-address = 127.0.0.1 to 0.0.0.0
Step iv:
Yous can too change startup settings of MySQL subsequently system kick-upward through the systemctl commands.
Step 5:
You will need to restart mysql service to take effect of all the changes to do that execute the following control in your terminal window.
$ sudo systemctl restart mysql
Footstep half dozen:
Y'all can check the MySQL post usage and IP address by using the listening command.
Step vii:
Y'all should make certain that the firewall doesn't end incoming connections from SQL port that port 3306. For this purpose, you should requite the following command in the terminal window.
$ sudo ufw allow from whatsoever to any port 3306 proto tcp
Setting up a MySQL DBMS system on Ubuntu:
Now I am going to evidence you lot how to set up a fully functional and complete MySQL server that can exist accessed from remote hosts. First of all, you volition demand to create a database, and then a user account, then allow other users to access your server remotely via the following steps.
Step i:
Outset MySQL service with root privileges; it opens up the mysql beat.
Step 2:
Now setting up database requires some basic MySQL commands; we will bear witness yous the most basic commands used in creating and starting the database, just you have to bank check MySQL documentation and tutorials for further help. Create a new database using the following command, supersede database1 with your desired text.
Step three:
At present create a user account that will have necessary privileges to the database1 through the following shell command.
mysql> CREATE USER 'my_user'@'%' IDENTIFIED BY 'passwrd_1';
This will create a user business relationship with the login name "my_user" and a password "password_1", "%" gives allows remote access from anywhere through the internet.
Step four:
At present requite permissions the new user business relationship to view or edit/modify this database with the following shell command.
Step 5:
Salve all these changes and leave the MySQL vanquish terminal window.
Conclusion:
We take covered how to install MySQL client bundle, how to install the MySQL server parcel, and how to set up a MySQL database. Nosotros have also shown you how to grant access to accounts for remote admission to the server or a database.
Source: https://linuxhint.com/install_mysql_ubuntu_20-04/
Posted by: mezathonegive.blogspot.com
0 Response to "How To Install Database In Linux"
Post a Comment