Showing posts with label Xampp. Show all posts
Showing posts with label Xampp. 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)]>



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

Wednesday, February 12, 2014

What is a MySQL Workbench?


It is a graphic user interface with which you can connect to a MySQL Server running on your computer. This is very similar to SQL Server Management Studio for Microsoft SQL Servers. There are some common features but you can only use it with MySQL server. You can create database, tables; run queries; create stored procedures; etc. The present version is 6.0.9 and you can download an msi file from here:

http://dev.mysql.com/downloads/tools/workbench/

you may need to register.

Here is what it looks like:


I have connected to MySQL server installed using XAMPP using two Local\NamedPipes and Standard TCPIP. You can access all the shortcuts on the right to interact with various MySQL related resources.

Sunday, February 9, 2014

On Installing Apache on Windows 7 64bit

The best way to install APACHE or the LAMP stack is to use the XAMPP cross-platform web server solution stack XAMPP. All you need to do is to downlaod, extract and start.

You can download XAMPP form here. You can install version 1.8.3 for Windows from the indicated link. XAMPP was howevver download from here:

http://download.cnet.com/XAMPP/3000-10248_4-10703782.html

The two latest versions are,

XAMPP is documented as a very easy program to install and run, but sometimes if your computer is running other programs like IIS, Skype, SQL Server Reporting Services, Oracle etc as it does on my computer you could get into a situation that makes it hard to install the XAMPP bundle.

The first mistake I made was to download XAMPP to a folder on my desktop. The recommended one is to use C:\XAMPP folder. As I installed on the desktop, the registration in my Windows Services,  the file for the service to run location here:
C:\Users\mysorian\Desktop\xampp\xampp\apache\bin\httpd.exe" -k runservice

Any number of install/uninstall operations did not change this path for the executable.


Later I installed XAMPP to C:\XAMPP but took 'apache/bin' contents to the path shown (above figure) in Apache2.4 Properties page.

The downloading and installing from CNET link was quite easy. Here are some screen shots. The next screen is dispalyed when you double click the XAMPP executable.


Click OK.


Click Next.

Click Next to indicate the location of the installation folder.


Click Next.


Click Next.


Click Finish

This completes the installation. Now you can double click xampp-control.exe in the installation directory that brings up the XAMPP Control Panel as shown. You can Start, stop and configure the packged programs Apache, MySql etc.



The problem that I encountered were the highlighted error messages reagrding Port 80 and Port 443. These ports are used by default by Internet Information Services and Skype. 

I managed to change the ports of Skype. Click here to see how it was done.
In spite of changing the SKYPE's Port 80 to something different and that of IIS binding to a different port, still the errors continued.


Since I could not succeed keeping 80 for APACHE, I decided to change APACHE to listen to a different port (8081) and reverted my IIS bound to its defult 80. I thought I could succeed and XAMPP control continued sending out error messages. 

I started apache service from Windows Services and the apache started without any problem after I made adjustment for bin/apache location as mentioned in the beginning.


------5:00:55 PM  [main] Initializing Control Panel
5:00:55 PM  [main] Windows Version: Windows 7 Ultimate SP1 64-bit
5:00:55 PM  [main] XAMPP Version: 1.8.3
5:00:55 PM  [main] Control Panel Version: 3.2.1  [ Compiled: May 7th 2013 ]
5:00:55 PM  [main] You are not running with administrator rights! This will work for
5:00:55 PM  [main] most application stuff but whenever you do something with services
5:00:55 PM  [main] there will be a security dialogue or things will break! So think
5:00:55 PM  [main] about running this application with administrator rights!
5:00:55 PM  [main] XAMPP Installation Directory: "c:\xampp\"
5:00:55 PM  [main] Checking for prerequisites
5:00:55 PM  [main] All prerequisites found
5:00:55 PM  [main] Initializing Modules
5:00:55 PM  [Apache] Apache Service detected with wrong path
5:00:55 PM  [Apache] Change XAMPP Apache and Control Panel settings or
5:00:55 PM  [Apache] Uninstall/disable the other service manually first
5:00:55 PM  [Apache] Found Path: "C:\Users\mysorian\Desktop\xampp\xampp\apache\bin\httpd.exe" -k runservice
5:00:55 PM  [Apache] Expected Path: "c:\xampp\apache\bin\httpd.exe" -k runservice
5:00:55 PM  [Apache] Problem detected!
5:00:55 PM  [Apache] Port 80 in use by "Unable to open process" with PID 4!
5:00:55 PM  [Apache] Apache WILL NOT start without the configured ports free!
5:00:55 PM  [Apache] You need to uninstall/disable/reconfigure the blocking application
5:00:55 PM  [Apache] or reconfigure Apache and the Control Panel to listen on a different port
5:00:55 PM  [Apache] Problem detected!
5:00:55 PM  [Apache] Port 443 in use by "C:\Program Files (x86)\Skype\Phone\Skype.exe" with PID 2624!
5:00:55 PM  [Apache] Apache WILL NOT start without the configured ports free!
5:00:55 PM  [Apache] You need to uninstall/disable/reconfigure the blocking application
5:00:55 PM  [Apache] or reconfigure Apache and the Control Panel to listen on a different port
5:00:55 PM  [Tomcat] Problem detected!
5:00:55 PM  [Tomcat] Port 8080 in use by "C:\oraclexe\app\oracle\product\11.2.0\server\BIN\tnslsnr.exe"!
5:00:55 PM  [Tomcat] Tomcat WILL NOT start without the configured ports free!
5:00:55 PM  [Tomcat] You need to uninstall/disable/reconfigure the blocking application
5:00:55 PM  [Tomcat] or reconfigure Tomcat and the Control Panel to listen on a different port

The XAMPP -Control contiues to show errors,


My guess is that this control has a problem. It is not related to the configuration of this controller.
But the XAMPP site working at http://127.0.0.1:8081
as shown.

Note: I also had MariaDB which was interfering with XAMPP's MySQL. I removed MariaDB which allowed me to run MySQL error free.

Summarize the important points:

1. Install XAMPP to C:\XAMPP folder
2. Do not try to change IIS bindings, but change the httpd.config file and choose Apache ports different from that of IIS and Skype.
3. Do the same for other contentions as well.




Do you want to change the ports that Skype use?


The ports that Skype (version 6.11)  uses are 443 and 80 by default. These ports are also used by other programs like IIS, XAMPP etc. Some times you may need to change the port that skype uses to some other port.

You can change the ports that Skype uses by first launching SKYPE,



Click Tools and then Options.... Now you see the defaults when you click Advanced and followed by clicking Connection as shown.


Uncheck the check box and choose a different port. The new ports will become acctive when you start SKYPE next time. I had to quit the program and login again to display the changed conditions.



Wednesday, April 15, 2009

I installed MySQL, how do I know what version I have and how to start and stop it?

If you installed MySQL it is probably in the directory where it is installed. For example, I recently installed XMAPP which brings in a bundle of stuff like Apache, MySQL, PHP etc. In this case, it was installed in the Xampp directory in the C drive.

You have to see if you have an executable program called mysql.exe among many other executbles and confi files.

If you have mysql.exe you should try to connect to it as in the following
snippet:

C:\xampp\mysql\bin>mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 36
Server version: 5.1.30-community MySQL Community Server (GPL)


Type 'help;' or '\h' for help. Type '\c' to clear the buffer.


Try the help and get everything you need

The control should now go over from C:\ to mysql>

The first thing to do is to verify the version you have on your computer.

For this, do this, do not forget the semi-colon:

mysql> Select version(),Current_Date;
+------------------+--------------+
| version()        | Current_Date |
+------------------+--------------+
| 5.1.30-community | 2009-04-13   |
+------------------+--------------+
1 row in set (0.05 sec)

I assume you have no start and stop shortcuts for the server. If you do have you can start and stop from the shortcuts or when you have a window with start and stop buttons for the server.