LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-23-2013, 08:16 AM   #1
bloodstreetboy
Member
 
Registered: May 2012
Posts: 201
Blog Entries: 3

Rep: Reputation: 37
ubuntu - LAMPP's mysql and apache2's mysql are overlapped


I have LAMPP and apache2 both are installed on my ubuntu.
I installed mysql using
Code:
sudo apt-get install mysql-server mysql-common mysql-client
for apache2.
But I don't know how my lampp's mysql and apache2's mysql have been overlapped.

If I want to run my apache2's project which are in /var/www directory.
I have to run following process
1) stop lampp first (for starting apache2 otherwise it gives another weserver is runing error), then
2) start apache2, then
3) start lampp again (for running LAMPP's mysql).

service start mysql does not work for me, I have to run LAMPP's mysql to run my apache2's project.
status of mysql should be stopped otherwise LAMPP's mysql is not started and if LAMPP's mysql is not started, it does connect my database.

Even I am not able to connect on command line from service start mysql, I have to run LAMPP for mysql prompt.

LAMPP is working fine, it does not depend on apache2 and default mysql package.
Any help would be appreciated.
 
Old 03-23-2013, 11:52 PM   #2
sherinlist
LQ Newbie
 
Registered: Mar 2013
Posts: 16

Rep: Reputation: Disabled
Hi,

You have following packages in your ubuntu

1. apache2 provided by ubtuntu: this installed mysql along with php mysql extension I guess.

2. LAMP: This includes sepaarate apache and a separae mysql

It seems that you are using mysql provided by LAMP for both web servers.

Now, your issue is that you want to run apache2 along with mysql provided by LAMP.

>> But I don't know how my lampp's mysql and apache2's mysql have been overlapped.

This is how it is. Each service is running in a port. Apache is running on 80 port and mysql on 3306 port. So, you can't run 2 web servers or database servers at a time.

However, you can change port of the apache & mysql to make all of them run at a time. However, this involves configuration changes.

If you are ready to do this, LQ forum users can help you.

--
sherin
 
Old 03-24-2013, 02:35 AM   #3
bloodstreetboy
Member
 
Registered: May 2012
Posts: 201

Original Poster
Blog Entries: 3

Rep: Reputation: 37
Quote:
Originally Posted by sherinlist View Post

It seems that you are using mysql provided by LAMP for both web servers
Now, your issue is that you want to run apache2 along with mysql provided by LAMP.
YES I am using lampp`s mysql for both servers but I dont want to run apache2 with lampp's mysql. It is already running with lampp's mysql. I want to run apache2 with it's mysql.
Quote:
, you can't run 2 web servers or database servers at a time.
NO I don't want to run both servers together. I stop lampp when I run apache2 &vice versa. I just want both apache should use their own mysqls. Why apache2's projects show database connectivity with lampp's mysql. Apache2 is independent,why it depends on lampp's mysql. Why dont it use it's own mysql.

Last edited by bloodstreetboy; 03-24-2013 at 02:39 AM.
 
Old 03-25-2013, 09:21 AM   #4
eklavya
Member
 
Registered: Mar 2013
Posts: 636

Rep: Reputation: 142Reputation: 142
what does it show when you stop lampp completely and run apache2 & it's mysql.
First, forget that you have lampp, stop it completely and rename it.

Now run apache2 and try to log into your project. You can't because mysql is not running, it will give database error.
Now start mysql using
$ service start mysql
and try to login again.
If it gives error, what is that?
Try to open phpmyadmin, if it gives error, what is that?

Actually your apache2's mysql is damage, definitely it is giving some error and instead of fixing it, you are using lampp's mysql.
Simply they share same port, you have to close one before starting other.

If you fix your apache2's mysql, you do not need to use lampp's mysql.
 
Old 03-26-2013, 02:22 AM   #5
bloodstreetboy
Member
 
Registered: May 2012
Posts: 201

Original Poster
Blog Entries: 3

Rep: Reputation: 37
I have removed LAMPP completely. Now I start apache2 and try to log-into my project but I am not able to log-in. Invalid username & password
Now I start mysql using service start mysql and try to log into my php project but still I am not able to login. Invalid username & password
If I try to open phpmyadmin, it gives #2003:can't connect to host on 127.0.0.1
Now there is no LAMPP, even I have forget about LAMMP. Now how to start php project using apache2?
 
Old 03-26-2013, 09:32 AM   #6
eklavya
Member
 
Registered: Mar 2013
Posts: 636

Rep: Reputation: 142Reputation: 142
Ok, So you have forgotten LAMPP... Good... :-)

when you start apache2 and try to log in to your project, it shows Invalid username & password because mysql is not started.
when you start mysql and try to log in to your project and it shows Invalid username & password. here can be two reasons.
1) You have not created database here in this mysql (Remember this is different than lampp because lampp's database directory is /opt/lampp/var/mysql and apache2's mysql directory is /var/lib/mysql so don't compare and confuse with these two, both are different)
2) and most probably your database configuration is damage because you have said in above comment
Quote:
If I try to open phpmyadmin, it gives #2003:can't connect to host on 127.0.0.1
so try to open mysql on command prompt using
Code:
$ mysql -h your-host-name -u your username -p
it will give some error, fix the error first and then connect your project with the database.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu: apache2 + mysql REAAALLLY SLOW even SSH access Tarikc Linux - Server 16 11-23-2012 06:52 AM
Apache2, PHP5, or MYSQL issue: Unable to jump to row 0 on MySQL ..... MTAS Linux - Server 5 03-26-2010 09:13 AM
[SOLVED] website not doing anything Using Ubuntu, mysql, apache2, php and firefox as browser drk2009 Linux - Newbie 4 07-30-2009 06:01 AM
configuring lampp mysql Eugene.Maritim Linux - Newbie 1 05-02-2009 04:41 PM
Problems upgrading MySQL on Ubuntu, with Apache2/PHP4 peruvianllama Linux - Software 0 08-16-2005 09:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration