<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>12_MariaDB by Murad Isa</title>
      <link>https://padlet.com/murado/mysql_database_server</link>
      <description></description>
      <language>en-us</language>
      <pubDate>2015-08-16 16:07:41 UTC</pubDate>
      <lastBuildDate>2019-07-27 11:59:59 UTC</lastBuildDate>
      <webMaster>hello@padlet.com</webMaster>
      <image>
         <url></url>
      </image>
      <item>
         <title>MariaDB</title>
         <author>murado</author>
         <link>https://padlet.com/murado/mysql_database_server/wish/77337207</link>
         <description><![CDATA[<div>MariaDB is an open source, multi-threaded relational database management system, backward compatible replacement for MySQL. It is maintained and developed by the <a href="https://mariadb.org/about/">MariaDB Foundation</a> including some of the original developers of the MySQL.<br><br></div><div><a href="https://linuxize.com/post/how-to-install-mariadb-on-ubuntu-18-04/#installing-mariadb-on-ubuntu-18-04"><strong>Installing MariaDB on Ubuntu 18.04<br></strong></a>At the time of writing this article, MariaDB version 10.1 is included in the Ubuntu main repositories.<br><br></div><div>To install MariaDB on Ubuntu 18.04, follow these steps:<br><br># <strong>apt  update<br></strong><br># <strong>apt install mariadb-server</strong><br><br>The MariaDB service will start automatically.<br><br># <strong>systemctl status mariadb<br></strong><br></div><div>check the MariaDB:<br># <strong>mysql  -V</strong></div><div><br></div><div><a href="https://linuxize.com/post/how-to-install-mariadb-on-ubuntu-18-04/#securing-mariadb"><strong>Securing MariaDB<br></strong></a>Run the mysql_secure_installation command to improve the security of the MariaDB installation:<br><br></div><pre># mysql_secure_installation</pre><div><br>*The script will prompt you to set up the root user password, remove the anonymous user, restrict root user access to the local machine and remove the test database. At the end the script will reload the privilege tables ensuring that all changes take effect immediately.<br><br></div><div>All steps are explained in detail and it is recommended to answer “Y” (yes) to all questions.</div><div><a href="https://linuxize.com/post/how-to-install-mariadb-on-ubuntu-18-04/#connect-to-mariadb-from-the-command-line"><strong><br>Connect to MariaDB from the command line</strong></a><strong><br></strong><br></div><div>To connect to the MariaDB server through the terminal we can use the MariaDB client.<br><br></div><div>To log in to the MariaDB server as the root user type:<br><br></div><pre>mysql -u root -p</pre><div><br>You will be prompted to enter the root password you have previously set when the mysql_secure_installation script was run.<br><br></div><div>Once you enter the password you will be presented with the MariaDB shell as shown below:<br><br></div><pre>Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 49
Server version: 10.1.29-MariaDB-6 Ubuntu 18.04

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.</pre><div><br>If you prefer a web interface over command line, you can <a href="https://linuxize.com/post/how-to-install-and-secure-phpmyadmin-with-apache-on-ubuntu-18-04/">install phpMyAdmin</a>and manage your MariaDB databases and users through it.</div><div><a href="https://linuxize.com/post/how-to-install-mariadb-on-ubuntu-18-04/#conclusion"><strong><br></strong></a><a href="https://linuxize.com/post/how-to-manage-mysql-databases-and-users-from-the-command-line/">How to manage MySQL user accounts and databases</a></div><ul><li><a href="https://linuxize.com/post/how-to-reset-a-mysql-root-password/">How to reset a MySQL root password</a></li><li><a href="https://linuxize.com/post/how-to-create-a-mysql-database/">How to Create a MySQL Database</a></li><li><a href="https://linuxize.com/post/how-to-create-mysql-user-accounts-and-grant-privileges/">How to Create MySQL Users Accounts and Grant Privileges</a></li><li><a href="https://linuxize.com/post/how-to-show-mysql-users/">How to Show MySQL Users</a></li><li><a href="https://linuxize.com/post/how-to-back-up-and-restore-mysql-databases-with-mysqldump/">How to Back Up and Restore MySQL Databases with Mysqldump</a></li></ul><div><br><br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2015-10-25 10:10:08 UTC</pubDate>
         <guid>https://padlet.com/murado/mysql_database_server/wish/77337207</guid>
      </item>
      <item>
         <title>Manage MySQL Databases and Users</title>
         <author>murado</author>
         <link>https://padlet.com/murado/mysql_database_server/wish/372439071</link>
         <description><![CDATA[<div>MySQL is the most popular open-source relational database management system. MySQL server allows us to create numerous users and databases and grant appropriate privileges so that users can access and manage databases.<br><br></div><div>Use command line to create and manage MySQL or MariaDB databases and users.</div><div><a href="https://linuxize.com/post/how-to-manage-mysql-databases-and-users-from-the-command-line/#before-you-begin"><strong><br></strong></a>To open the MySQL prompt(enter the MySQL root user password)</div><pre>mysql -u root -p</pre><div><a href="https://linuxize.com/post/how-to-manage-mysql-databases-and-users-from-the-command-line/#create-a-new-mysql-database"><strong><br>Create a new MySQL database</strong></a></div><pre>CREATE DATABASE database_name;</pre><div><a href="https://linuxize.com/post/how-to-manage-mysql-databases-and-users-from-the-command-line/#list-all-mysql-databases"><strong><br>List all MySQL databases</strong></a></div><pre>SHOW DATABASES;</pre><div><a href="https://linuxize.com/post/how-to-manage-mysql-databases-and-users-from-the-command-line/#delete-a-mysql-database"><strong><br></strong></a><a href="https://linuxize.com/post/how-to-manage-mysql-databases-and-users-from-the-command-line/#create-a-new-mysql-user-account"><strong>Create a new MySQL user account<br></strong></a>A user account in MySQL consists of a user name and host name parts.</div><div><br></div><pre>CREATE USER 'username'@'localhost' IDENTIFIED BY 'user_password';</pre><div><br>In the command above we have set the hostname part to localhost which means that this user will be able to connect to the MySQL server only from the localhost ( i.e from the system where MySQL Server runs). <br><br>If you want to grant access from another host(s) just change the localhost with the remote machine IP or use '%' wildcard for the host part, which means that the user account will be able to connect from any host.<br><br></div><div><a href="https://linuxize.com/post/how-to-manage-mysql-databases-and-users-from-the-command-line/#change-a-mysql-user-account-password"><strong>Change a MySQL user account password</strong></a></div><pre>ALTER USER 'username'@'localhost' IDENTIFIED BY 'new_password';</pre><div><a href="https://linuxize.com/post/how-to-manage-mysql-databases-and-users-from-the-command-line/#list-all-mysql-user-accounts"><strong><br>List all MySQL user accounts</strong></a></div><pre>SELECT user, host FROM mysql.user;</pre><div><a href="https://linuxize.com/post/how-to-manage-mysql-databases-and-users-from-the-command-line/#delete-mysql-user-account"><strong><br>Delete MySQL user account</strong></a></div><pre>DROP USER 'username@'localhost';</pre><div><a href="https://linuxize.com/post/how-to-manage-mysql-databases-and-users-from-the-command-line/#grant-permissions-to-a-mysql-user-account"><strong><br>Grant permissions to a MySQL user account</strong></a></div><div>There are multiple types of privileges that can be granted to a user account. You can find a full list of privileges supported by MySQL <a href="https://dev.mysql.com/doc/refman/5.7/en/grant.html">here</a>. In this guide we will go through several examples:<br><br></div><pre>GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost';</pre><div><br>If you want to grant only specific privileges to a user account over a specific database type:</div><pre>GRANT SELECT, INSERT, DELETE ON database_name.* TO 'username@'localhost';</pre><div><a href="https://linuxize.com/post/how-to-manage-mysql-databases-and-users-from-the-command-line/#revoke-permissions-from-a-mysql-user-account"><strong><br>Revoke permissions from a MySQL user account</strong></a></div><div>If you need to revoke one or more privileges or all privileges from a user account, the syntax is almost identical to granting it. For example, if you want to revoke all privileges from a user account over a specific database, use the following command:<br><br></div><pre>REVOKE ALL PRIVILEGES ON database_name.* TO 'database_user'@'localhost';</pre><div><br></div><div><a href="https://linuxize.com/post/how-to-manage-mysql-databases-and-users-from-the-command-line/#display-mysql-user-account-privileges"><strong><br>Display MySQL user account privileges<br></strong></a><br></div><div>To find the privilege(s) granted to a specific MySQL user account type:<br><br></div><pre>SHOW GRANTS FOR 'username'@'localhost'; 
<br></pre>]]></description>
         <enclosure url="" />
         <pubDate>2019-07-27 11:47:39 UTC</pubDate>
         <guid>https://padlet.com/murado/mysql_database_server/wish/372439071</guid>
      </item>
   </channel>
</rss>
