35

I installed XAMPP v3.2.1 because I wanted to learn how to create database in MySQL and learn more about TOMCAT. However, I am a little confused about what to do now. I have read many blogs and the documentation on this page http://dev.mysql.com/doc/refman/5.0/en/creating-database.html.

While following the directions I found that: I can't access my local host.

Attempted Solution: I shut down skype because I read that might be an issue. I don't have any older versions of XAMPP on my computer and I don't believe I am connected to any other servers. So, I don't have permission to do anything.

OR

Am I trying to access mysql through the wrong command prompt? I am trying to use MySQL from the XAMPP shell. I am not sure why I cannot get everything working. Am I going about this the wrong way?

Thanks for any help

JustBlossom
  • 1,259
  • 3
  • 24
  • 53
  • How are you attempting to access localhost? I think this requires a bit more specific information about what you are currently doing. – Andy G Jul 24 '13 at 00:23
  • I went to my browser (Chrome) and typed in http://localhost and I also tried http://127.0.0.1. I get "This webpage is not available". I am using Windows 7- 64 bit. – JustBlossom Jul 24 '13 at 00:26
  • 1
    Did you start the web server? Do you have IIS on your computer? IIS tends to commandeer port 80. – Andy G Jul 24 '13 at 00:30
  • Do you mean did I press "start" next to MySQL on the xampp console? If so yes. If not, I don't understand what you mean. And no I don't think I have IIS, I looked for it under control panel>add remove programs and didn't see it. – JustBlossom Jul 24 '13 at 00:35
  • I checked this to make sure : http://stackoverflow.com/questions/1165053/check-whether-iis-is-installed-or-not – JustBlossom Jul 24 '13 at 00:36
  • 1
    MySQL and apache is diffrent thing.. if you want to see if MySQL Running or not you can go to `services` and see if any service named `MySQL` is running.. or you can use `MySQL GUI Browser` to connect to your MySQL Server. you can download here http://dev.mysql.com/downloads/gui-tools/5.0.html – Daniel Robertus Jul 24 '13 at 01:23
  • 1
    Oh, I thought MyQSL was a branch of Apache. So I can't just download XAMPP and be finished? I have to get the rest of the MySQL software (ie GUI Browser)? – JustBlossom Jul 24 '13 at 02:47

4 Answers4

57

XAMPP only offers MySQL (Database Server) & Apache (Webserver) in one setup and you can manage them with the xampp starter.

After the successful installation navigate to your xampp folder and execute the xampp-control.exe

Press the start Button at the mysql row.

enter image description here

Now you've successfully started mysql. Now there are 2 different ways to administrate your mysql server and its databases.

But at first you have to set/change the MySQL Root password. Start the Apache server and type localhost or 127.0.0.1 in your browser's address bar. If you haven't deleted anything from the htdocs folder the xampp status page appears. Navigate to security settings and change your mysql root password.

Now, you can browse to your phpmyadmin under http://localhost/phpmyadmin or download a windows mysql client for example navicat lite or mysql workbench. Install it and log in to your mysql server with your new root password.

enter image description here

kastermester
  • 3,058
  • 6
  • 28
  • 44
Hidden
  • 3,598
  • 4
  • 34
  • 57
  • 3
    Thank you so much! That is exactly what I needed. I understand what the difference between XAMPP and MySQL are, and I was able to get into the local host. I installed the workbench, which from my understanding, is where all the "magic" and work happens. The only thing I am not sure how to do is get to the CFG Server Connection Properties you have in the second screen shot.How did you get there, through the workbench? I looked here: http://dev.mysql.com/doc/workbench/en/wb-manage-db-connections-standard.html, but was not sure if that's how you came to what you got above? – JustBlossom Jul 24 '13 at 17:10
  • 1
    The second screenshot is the connection manager from navicat light. – Hidden Jul 24 '13 at 21:20
4

XAMPP Apache + MariaDB + PHP + Perl (X -any OS)

  • After successful installation execute xampp-control.exe in XAMPP folder
  • Start Apache and MySQL enter image description here

  • Open browser and in url type localhost or 127.0.0.1

  • then you are welcomed with dashboard

By default your port is listing with 80.If you want you can change it to your desired port number in httpd.conf file.(If port 80 is already using with other app then you have to change it).

For example you changed port number 80 to 8090 then you can run as 'localhost:8090' or '127.0.0.1:8090'

Ramlal S
  • 1,573
  • 1
  • 14
  • 34
0

Changing XAMPP Default Port: If you want to get XAMPP up and running, you should consider changing the port from the default 80 to say 7777.

  • In the XAMPP Control Panel, click on the Apache – Config button which is located next to the ‘Logs’ button.

  • Select ‘Apache (httpd.conf)’ from the drop down. (Notepad should open)

  • Do Ctrl+F to find ’80’ and change line Listen 80 to Listen 7777

  • Find again and change line ServerName localhost:80 to ServerName localhost:7777

  • Save and re-start Apache. It should be running by now.

The only demerit to this technique is, you have to explicitly include the port number in the localhost url. Rather than http://localhost it becomes http://localhost:7777.

kenlukas
  • 3,616
  • 9
  • 25
  • 36
-6
<?php
if(!@mysql_connect('127.0.0.1', 'root', '*your default password*'))
{
    echo "mysql not connected ".mysql_error();
    exit;

}
echo 'great work';
?>

if no error then you will get greatwork as output.

Try it saved my life XD XD

NeronLeVelu
  • 9,908
  • 1
  • 23
  • 43
ravi ranjan
  • 143
  • 1
  • 4
  • 18
    If you're using `mysql_query` you've already failed, and secondly, using that with the error-suppressing YOLO operator `@` is even more insane. If you've just popped out of a time capsule from 1998 you really need to read up on [modern best practices](http://www.phptherightway.com/). – tadman Mar 09 '15 at 15:11
  • 2
    @tadmin if this works, it helps beginners to get started. why not? – Bitterblue Apr 05 '18 at 07:28
  • 1
    Yeah its helping beginner to get started but why start with something which is not a best practice ? – Kopi Bryant May 21 '20 at 09:27