LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 11-01-2009, 10:37 AM   #1
KellyT
LQ Newbie
 
Registered: May 2007
Location: Thirsk, North Yorkshire, UK
Distribution: Ubuntu
Posts: 13

Rep: Reputation: 0
Installing PHP and MySQL on Ubuntu Server 9.10


Hi,

Apologies if this is the wrong forum for this question, but it is server-related.

I recently bought an Acer Aspire Revo which I thought I would set up as an local development server using the server edition of Ubuntu Koala.
I downloaded the server edition and installed it successfully, and during the installation process, I selected MySQL, PHP, DNS and Mail server packages to be installed amongst others. So far so good - all went well.

When I'd finished the installation I ran http://localhost and it came up with the page indicating that the web server is running.
I then wanted to install PhpMyAdmin to make my life easier (this is a local dev server only). I downloaded it, and installed it, but when I ran it, it said 'Could not connect to MySQL server'.
So I thought maybe I needed to start MySQL manually. I went to the MySQL folder and ran sudo mysql start and got the message 'Access denied for user 'root@localhost' (using password: NO)'.

MySQL is installed, and I can see it in the phpinfo() script that I created.

What am I doing wrong? I presume I've missed something obvious but I've never set up a web server before, only used ones which have been pre-setup!

Please can you help?

Thanks!

Kelly

Last edited by KellyT; 11-01-2009 at 10:41 AM.
 
Old 11-01-2009, 10:43 AM   #2
janoszen
Member
 
Registered: Oct 2009
Location: Budapest
Distribution: Mostly Gentoo, sometimes Debian/(K)Ubuntu
Posts: 143

Rep: Reputation: 22
MySQL

Can you log in from the console? If yes, change your root password, then try again with that.
 
Old 11-01-2009, 11:22 AM   #3
KellyT
LQ Newbie
 
Registered: May 2007
Location: Thirsk, North Yorkshire, UK
Distribution: Ubuntu
Posts: 13

Original Poster
Rep: Reputation: 0
I've tried that, unfortunately no matter what I do it gives the same error: 'Access denied for user 'root@localhost' (using password: NO)'.

I've tried setting a password and removing the 'log in without password' option and still the same effect, but 'Access denied for user 'root@localhost' (using password: YES)'.

Any other ideas?
 
Old 11-01-2009, 11:41 AM   #4
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296
Hello,

The MySQL root user IS NOT the same as the root user on your system. Normally if you installed MySQL at some time it asked you to set a root password. It's with that password that you have to access the MySQL console. I don't know if this is going to work, but since Ubuntu is Debian based I hope it does.

Open a console and find out if mysql-server is installed
Code:
sudo dpkg -l 'mysql-server'
If it is installed
Code:
sudo dpkg-reconfigure mysql-server
That last one should get you back at the 'configuration' level of the MySQL server where you can set your password. Remember that root for MySQL is not the root user of your system.

Kind regards,

Eric
 
Old 11-01-2009, 01:52 PM   #5
KellyT
LQ Newbie
 
Registered: May 2007
Location: Thirsk, North Yorkshire, UK
Distribution: Ubuntu
Posts: 13

Original Poster
Rep: Reputation: 0
Hi Eric,

Thanks for your help. Mysql server is installed however the last command you gave does nothing - just returns to the prompt.

Could it possibly be that the problem is in fact with my PhpMyAdmin installations, rather than the MySQL server?

Thanks,

Kelly
 
Old 11-01-2009, 02:02 PM   #6
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296
Hello Kelly,

Could you try what's explained in the post by centosboy in this thread?

That's another way to 'reset' the MySQL root user password.

Kind regards,

Eric
 
Old 11-02-2009, 08:15 AM   #7
KellyT
LQ Newbie
 
Registered: May 2007
Location: Thirsk, North Yorkshire, UK
Distribution: Ubuntu
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks Eric, I followed the advice in the other thread and it is working now - I can log in and see my databases.

Thanks very much for your help.

Kelly
 
Old 11-02-2009, 08:26 AM   #8
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296
No problem, glad it worked.

Kind regards,

Eric
 
  


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
Installing mysql server on ubuntu 9.04. tareque Linux - Software 1 10-01-2009 06:05 AM
Installing and Configuring MySQL, Apache, and PHP on (Ubuntu) Linux gagne.marc Linux - Software 4 02-21-2009 04:23 PM
LXer: Installing Cherokee Web Server With PHP 5 & MySQL 5 Support On Ubuntu 8.10 LXer Syndicated Linux News 0 12-01-2008 11:20 AM
Installing MySQL.4.0.17 and php support for Mysql on RedHat 9.0 Neha Linux - Software 13 12-29-2003 01:06 AM
Installing PHP and MySQL w/ Apache web server dcrealm47 Linux - Newbie 5 02-26-2003 12:21 PM

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

All times are GMT -5. The time now is 06:34 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration