LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-27-2012, 02:23 AM   #1
kuser:)
Member
 
Registered: Sep 2005
Location: Olsztyn, Poland
Distribution: Slackware 14.1
Posts: 168

Rep: Reputation: 99
problems with lamp (linux apache mysql php


Insted of the tutorial below, I suggest this one:
http://youtu.be/-q8Jj4aAWYw
------------------------------------------------------------------
I tried to install LAMP (linux apache mysql php), but now I can't login to either mysql, or phpmyadmin.

I followed this tutorial, but it's outdated:
http://community.linuxmint.com/tutorial/view/486

The actual process differs a bit, and I got confused with which password is for what, and I think I made some typos in the passwords themselves, so now I'm screwed. Even if I'd like to redo the whole installation, I don't know how to uninstall what I have now before I start with a new installation.

When I'm trying to login to phpmyadmin I get these 2 errors:
At the top:
Quote:
#1045 Cannot log in to the MySQL server
At the bottom:
Quote:
Connection for controluser as defined in your configuration failed.

Last edited by kuser:); 02-27-2012 at 07:01 AM.
 
Old 02-27-2012, 02:28 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

Did your installation finish correctly? Check if you have the MySQL server installed:
Code:
dpkg -l 'mysql-server*'
If MySQL is only 'misconfigured' you can try running:
Code:
dpkg-reconfigure mysql-server
as root or with sudo.

Since, if I'm not mistaking, PHPMyAdmin relies on MySQL that part could be solved when you have your MySQL issue solved.

Kind regards,

Eric
 
Old 02-27-2012, 03:35 AM   #3
kuser:)
Member
 
Registered: Sep 2005
Location: Olsztyn, Poland
Distribution: Slackware 14.1
Posts: 168

Original Poster
Rep: Reputation: 99
Code:
sudo dpkg -l 'mysql-server*'
[sudo] password for [edited]:
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name            Version         Description
+++-===============-===============-==============================================
ii  mysql-server    5.1.58-1ubuntu1 MySQL database server (metapackage depending o
un  mysql-server-4. <none>          (no description available)
un  mysql-server-5. <none>          (no description available)
ii  mysql-server-5. 5.1.58-1ubuntu1 MySQL database server binaries and system data
un  mysql-server-co <none>          (no description available)
un  mysql-server-co <none>          (no description available)
ii  mysql-server-co 5.1.58-1ubuntu1 MySQL database server binaries
This command:
Code:
sudo dpkg-reconfigure mysql-server
didn't give any messages in terminal. It simply went back to command prompt.
-------------------------------------------------------------------
I used:
Quote:
sudo dpkg-reconfigure mysql-server-5.1
and that allowed me to reset the mysql password.
Then I created mysql by creating a php file:
Quote:
sudo touch dbtest.php
and edited it:
Quote:
sudo nano dbtest.php
and inserted this code:
Quote:
<?php
// hostname or ip of server (for local testing, localhost should work)
$dbServer='localhost';

// username and password to log onto db server
$dbUser='root';
$dbPass='[edited]';

// name of database
$dbName='test';

$link = mysql_connect("$dbServer", "$dbUser", "$dbPass") or die("Could not connect: ". mysql_error());
print "Connected successfully<br>";
mysql_select_db("$dbName") or die("Could not select database");
print "Database selected successfully<br>";

// close connection
mysql_close($link);
?>
then I typed this address in firefox:
Quote:
localhost/dbtest.php
and I got this page:
Quote:
Connected successfully
Could not select database
I fixed this by creating the database in phpmyadmin. (d-uh!)
Used this to reconfigure phpmyadmin:
Quote:
sudo dpkg-reconfigure phpmyadmin
So now all works, except that error:
Quote:
sudo /etc/init.d/apache2 start
* Starting web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[ OK ]
---------------------------------------------------------
Found it!
Quote:
By default httpd.conf file will be blank. Now, simply add the following line to the file.
ServerName localhost
Save the file and exit vi (or gedit).
Finally restart the server.

$ sudo service apache2 restart
from:
http://johnsjavapda.blogspot.com/201...determine.html

Thank you for help, EricTRA and others!!!

Last edited by kuser:); 02-27-2012 at 08:04 AM.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
lamp linux apache mysql php not installed yuganrrhce Linux - Newbie 6 01-07-2009 07:10 AM
no LAMP subdivision in LQ (LInux,Apache,PHP,MYSQL) sailu_mvn LQ Suggestions & Feedback 2 02-28-2007 08:55 AM
Setting Up LAMP: Getting Linux, Apache, MySQL, and PHP Working Together rhythmking Slackware 2 06-08-2005 04:05 AM
LAMP(Linux,Apache,MySql,PHP) and other info hamtavs General 1 01-25-2005 03:54 AM
LAMP(Linux, Apache, MySQL, PHP) Problem gamehack Slackware 7 08-17-2004 02:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:31 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