Difference between revisions of "MariaDB"

From wikieduonline
Jump to navigation Jump to search
({{CC license}} Original Source: https://en.wikiversity.org/wiki/MariaDB)
 
Line 52: Line 52:
 
# Allow remote root access: <code>GRANT ALL PRIVILEGES on *.* to 'root'@'%' IDENTIFIED BY 'YOUR_PASSWORD';</code>
 
# Allow remote root access: <code>GRANT ALL PRIVILEGES on *.* to 'root'@'%' IDENTIFIED BY 'YOUR_PASSWORD';</code>
  
 +
== Advanced Features ==
 +
* Understand MariaDB [[w:partitioning]] (w:https://en.wikipedia.org/wiki/Comparison_of_relational_database_management_systems#Partitioning)  and uses cases<ref>https://mariadb.com/kb/en/library/partitioning-overview/</ref>. <code>SHOW PLUGINS</code> to see if your version support it.
 +
* Create a MariaDB Cluster using MariaDB [[/Galera Cluster/]]. <ref>https://mariadb.com/kb/en/library/what-is-mariadb-galera-cluster/</ref>
 +
 +
== See also ==
 +
* [[Databases]]: [[PostgreSQL]]
 +
* [[Wikipedia: MariaDB]]
 +
 +
== References ==
 +
{{reflist}}
 +
 +
[[Category:Databases]]
 +
[[Category:Server software]]
  
 
{{CC license}}
 
{{CC license}}
 
Original Source: https://en.wikiversity.org/wiki/MariaDB
 
Original Source: https://en.wikiversity.org/wiki/MariaDB

Revision as of 11:36, 12 December 2019

Activities

  1. Perform the following tasks:[1]
    • Install MariaDB. For example in MacOS: brew install mariadb
    • Start and configure MariaDB.
    • Backup and restore a database
    • Create a simple database schema
    • Perform simple SQL queries against a database
    • Create a basic table

Install and start MariaDB in MacOS

  • brew install mariadb
  • Start MariaDB:
/usr/local/bin/mysql.server start (command is mysql but you are actually starting MariaDB)
Starting MariaDB
.180619 10:15:19 mysqld_safe Logging to '/usr/local/var/mysql/file.err'.
180619 10:15:19 mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
 SUCCESS! 
  • Check MariaDB is running: /usr/local/bin/mysql.server status
 SUCCESS! MariaDB running (80662)

Create a table: CREATE TABLE

  • Connect to database test, will be created in default MariaDB installation:
mysql test
  • Create a basic table with two columns using the create table [2][3] SQL statement:
create table my_first_table (my_first_column char, my_second_column char);
  • Show tables so we can check our new created table is available:
MariaDB [test]> describe my_first_table;
+------------------+
| Tables_in_test   |
+------------------+
| my_first_table   |
+------------------+
  • Show details about your new table:
MariaDB [test]> describe my_first_table;
+------------------+---------+------+-----+---------+-------+
| Field            | Type    | Null | Key | Default | Extra |
+------------------+---------+------+-----+---------+-------+
| my_first_column  | char(1) | YES  |     | NULL    |       |
| my_second_column | char(1) | YES  |     | NULL    |       |
+------------------+---------+------+-----+---------+-------+
2 rows in set (0.003 sec)
  1. Show privileges: MariaDB [(none)]> show grants;
  2. Allow remote root access: GRANT ALL PRIVILEGES on *.* to 'root'@'%' IDENTIFIED BY 'YOUR_PASSWORD';

Advanced Features

See also

References

Script error: No such module "Check for unknown parameters".

Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Original Source: https://en.wikiversity.org/wiki/MariaDB

Advertising: