Showing posts with label MariaDB. Show all posts
Showing posts with label MariaDB. Show all posts

Thursday, November 26, 2015

How do you access MariaDB in XAMPP?

We have seen that MariaDB is an off spring of MySQL and when we launch (as administrator) XAMPP from its shortcut shown here:

 
XAMPP-Maria01.png

What we see displayed is the following (it is assumed any service running is stopped and the bottom pane is cleared):
 
XAMPP-Maria01.png

Click Start for MySQL and it is already running as shown here:

 
XAMPP-Maria03.png

MySQL is running on Port 3306.
Click on Shell.

The XAMPP prompt is displayed with the following message.
---
Setting environment for using XAMPP for Windows.
Jayaram@HODENTEK8 c:\j
#

----------------
When you enter mysql as shown you get the MariaDB prompt as shown
 
XAMPP-Maria04.png

MariaDB syntax is very similar to MySQL syntax as for as its usage is concerned.
Alternately you can do the same from the install directory as shown here:
-----------
Microsoft Windows [Version 10.0.10240]
(c) 2015 Microsoft Corporation. All rights reserved.

C:\Users\Jayaram>cd\

C:\>cd C:\J\mysql\bin

C:\J\mysql\bin>dir mysql*
 Volume in drive C is TI10672700E
 Volume Serial Number is 16FB-D230

 Directory of C:\J\mysql\bin

10/14/2015  10:44 PM         3,571,528 mysql.exe
10/14/2015  10:45 PM         3,517,768 mysqladmin.exe
10/14/2015  10:45 PM         3,595,080 mysqlbinlog.exe
10/14/2015  10:44 PM         3,515,208 mysqlcheck.exe
10/14/2015  10:45 PM        11,527,496 mysqld.exe
10/14/2015  10:44 PM         3,568,456 mysqldump.exe
10/14/2015  10:16 PM             8,385 mysqldumpslow.pl
10/14/2015  10:16 PM            25,817 mysqld_multi.pl
10/14/2015  10:16 PM            36,102 mysqlhotcopy.pl
10/14/2015  10:45 PM         3,506,504 mysqlimport.exe
10/14/2015  10:45 PM         3,507,528 mysqlshow.exe
10/14/2015  10:45 PM         3,525,448 mysqlslap.exe
10/14/2015  10:44 PM         3,916,616 mysqltest.exe
10/14/2015  10:48 PM         9,949,000 mysqltest_embedded.exe
10/14/2015  10:38 PM         3,899,392 mysql_client_test.exe
10/14/2015  10:48 PM        10,124,104 mysql_client_test_embedded.exe
10/14/2015  10:16 PM             8,799 mysql_config.pl
10/14/2015  10:16 PM             4,417 mysql_convert_table_format.pl
10/14/2015  10:48 PM         9,804,104 mysql_embedded.exe
10/14/2015  10:46 PM         3,735,368 mysql_install_db.exe
10/14/2015  10:45 PM         3,119,944 mysql_plugin.exe
10/14/2015  10:16 PM             9,565 mysql_secure_installation.pl
10/14/2015  10:46 PM         3,124,040 mysql_tzinfo_to_sql.exe
10/14/2015  10:45 PM         3,178,824 mysql_upgrade.exe
10/14/2015  10:46 PM         3,109,192 mysql_upgrade_service.exe
10/14/2015  10:57 PM         1,750,344 mysql_upgrade_wizard.exe
              26 File(s)     95,639,029 bytes
               0 Dir(s)  797,801,631,744 bytes free

C:\J\mysql\bin>mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 10.1.8-MariaDB mariadb.org binary distribution

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

Type 'help;' or '\h' for help. Typ
e '\c' to clear the current input statement.

----------------------------------------------------
You can also get to the administrator using the mysqladmin.exe as shown here (truncated portion):
 
XAMPP-Maria05.png

For MariaDB server find contents as shown here:

XAMPP-Maria06.png

MariaDB has good documentation. Here is the help on Utility | Use:
-----------------------------------------
MariaDB [(none)]> help Utility
You asked for help about help category: "Utility"
For more information, type 'help ', where is one of the following
topics:
   EXPLAIN
   HELP STATEMENT
   USE

MariaDB [(none)]> help USE
Name: 'USE'
Description:
Syntax:
USE db_name

The USE db_name statement tells MySQL to use the db_name database as
the default (current) database for subsequent statements. The database
remains the default until the end of the session or another USE
statement is issued:

USE db1;
SELECT COUNT(*) FROM mytable;   # selects from db1.mytable
USE db2;
SELECT COUNT(*) FROM mytable;   # selects from db2.mytable


Here are some queries run on this version:

 MariaDB Version
------------
MariaDB [(none)]> Select Version(), CURRENT_DATE;
+----------------+--------------+
| Version()      | CURRENT_DATE |
+----------------+--------------+
| 10.1.8-MariaDB | 2015-11-26   |
+----------------+--------------+
1 row in set (0.04 sec)

MariaDB [(none)]>

---------------------
 Find User interactively
---------
Find the USER() (this is interactively run)
----------------
MariaDB [(none)]> SELECT
    -> USER()
    -> ,
    -> CURRENT_DATE;
+----------------+--------------+
| USER()         | CURRENT_DATE |
+----------------+--------------+
| ODBC@localhost | 2015-11-26   |
+----------------+--------------+
1 row in set (0.00 sec)

MariaDB [(none)]>

--------------------
There are only two bases in the installation.
Show databases
-----------
MariaDB [(none)]> show databases
    -> ;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| test               |
+--------------------+
2 rows in set (0.08 sec)

MariaDB [(none)]>



Friday, November 20, 2015

What is the difference between MySQL and MariaDB?

MySQL predates MariaDB. In fact MariaDB is a fork of MySQL. MySQL was handed down from Sun Microsystems to Oracle which made it somewhat non-open source (http://hodentek.blogspot.com/2009/07/taking-table-over-to-mysql-from-ms.html) and a need for an open source version became desirable. MariaDB has found acceptance from the likes of Google(http://hodentek.blogspot.com/2013/09/mysql-is-challenged-by-its-fork.html) and others. Customers like RedHat,SUSE and WikiPedia have moved away from MySQL.

The reasons are obvious:

  • MariaDB has more storage engines then MySQL.
  • Better speed
  • Has new extensions and features
  • Better test and test suites
  • Fewer warnings and bug
  • Truly Open Source (GPL, LGPL or BSD)
  • Strong Community(https://mariadb.com/kb/en/who-is-behind-mariadb/)

Sunday, November 15, 2015

Where can I find XAMPP download with MariaDB for Windows?

MariaDB does lot more than MySQL and it is MySQL's challenger arising out of MySQL (MariaDB is MySQL's fork). MySQL in LAMP stack has been replaced by MariaDB. The download link for XAMPP with MariaDB  is here.

The download versions are v5.5.30 and v5.6.14 (both x32bit). These versions have  the following components and they can be downloaded from here.

    Updated PHP to 5.5.30 / 5.6.14
    Updated Apache to 2.4.17
    Updated MariaDB to 10.0.17
    Updated phpMyAdmin to 4.5.0.2


Xampp_Maria.png