Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 29th March 2010, 13:50
Riff Riff is offline
Junior Member
 
Join Date: Mar 2010
Location: England
Posts: 22
Thanks: 3
Thanked 0 Times in 0 Posts
Unhappy MySQL on Fedora 12: Install problems

Hi everyone

Apologies if this is in the wrong place, please relocate if necessary.

I'm very new to Fedora (and Linux generally) and I recently installed F12 using Falco's excellent guide for the Perfect Desktop. I have a very nice day to day machine on this now.

I'm trying to learn MySQL, and I then followed his guide for a LAMP server located here: http://www.howtoforge.com/installing...fedora-12-lamp

I installed MySQL and I seem to be able to get it running
but when I wanted to create a Password using

Quote:
mysqladmin -u root password yourrootsqlpassword
mysqladmin -h server1.example.com -u root password yourrootsqlpassword
I don't get the chance to change the PW and I get this error message:

connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'


Now, I'm a bit of a newbie and I'm struggling to locate the various bits of MySQL around my system etc, but I'll be very grateful for any advice.

Thanks in Advance!

Riff
Reply With Quote
Sponsored Links
  #2  
Old 30th March 2010, 14:48
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,711
Thanks: 1,900
Thanked 2,702 Times in 2,545 Posts
Default

Does the first or second mysqladmin command give you this error message?
What's the output of
Code:
netstat -tap
? What's in /etc/hosts?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 30th March 2010, 15:28
Riff Riff is offline
Junior Member
 
Join Date: Mar 2010
Location: England
Posts: 22
Thanks: 3
Thanked 0 Times in 0 Posts
Default

The output of netstat in root gives me this:

Quote:
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:sunrpc *:* LISTEN 1230/rpcbind
tcp 0 0 *:64436 *:* LISTEN 2073/skype
tcp 0 0 *:ssh *:* LISTEN 1523/sshd
tcp 0 0 localhost:ipp *:* LISTEN 1316/cupsd
tcp 0 0 *:49399 *:* LISTEN 1271/rpc.statd
tcp 0 0 localhost:smtp *:* LISTEN 1804/sendmail: acce
tcp 0 0 *:mysql *:* LISTEN 1654/mysqld
tcp 0 0 192.168.1.3:60801 64.12.30.84:https ESTABLISHED 2072/pidgin
tcp 0 0 192.168.1.3:54935 bos-d037b-rdr4.blue.a:https ESTABLISHED 2072/pidgin
tcp 0 0 192.168.1.3:55416 64.12.30.80:https ESTABLISHED 2072/pidgin
tcp 0 0 192.168.1.3:46774 oam-m12c.blue.aol.com:https ESTABLISHED 2072/pidgin
tcp 0 0 192.168.1.3:37921 wy-in-f148.1e100.net:http ESTABLISHED 2480/firefox
tcp 0 0 192.168.1.3:47679 cpc2-know3-0-0-cust12:15007 ESTABLISHED 2073/skype
tcp 0 0 192.168.1.3:50518 chatfarm-lm01b-sr01.e:https ESTABLISHED 2072/pidgin
tcp 0 0 192.168.1.3:50515 chatfarm-lm01b-sr01.e:https ESTABLISHED 2072/pidgin
tcp 0 0 192.168.1.3:47130 bos-d036a-rdr4.blue.a:https ESTABLISHED 2072/pidgin
tcp 0 0 192.168.1.3:36633 ez-in-f97.1e100.net:https ESTABLISHED 2480/firefox
tcp 0 0 192.168.1.3:53688 cs111.msg.ac4.yahoo.co:mmcc ESTABLISHED 2072/pidgin
tcp 0 0 192.168.1.3:43571 wy-in-f167.1e100.net:http ESTABLISHED 2480/firefox
tcp 0 0 192.168.1.3:36634 ez-in-f97.1e100.net:https ESTABLISHED 2480/firefox
tcp 0 0 192.168.1.3:37165 oam-d11b.blue.aol.com:https ESTABLISHED 2072/pidgin
tcp 0 0 192.168.1.3:58774 by2msg1010509.gateway.:msnp ESTABLISHED 2072/pidgin
tcp 0 0 192.168.1.3:50955 ew-in-f101.1e100.net:http ESTABLISHED 2480/firefox
tcp 0 0 192.168.1.3:38678 by2msg1020207.gateway.:msnp ESTABLISHED 2072/pidgin
tcp 0 0 *:sunrpc *:* LISTEN 1230/rpcbind
tcp 0 0 *:ssh *:* LISTEN 1523/sshd
tcp 0 0 localhost:ipp *:* LISTEN 1316/cupsd
the hosts file here:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 hellboy
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 hellboy

I hope that helps.
Reply With Quote
  #4  
Old 31st March 2010, 14:12
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,711
Thanks: 1,900
Thanked 2,702 Times in 2,545 Posts
Default

Looks ok. Did you set a MySQL root password before?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 31st March 2010, 19:23
Riff Riff is offline
Junior Member
 
Join Date: Mar 2010
Location: England
Posts: 22
Thanks: 3
Thanked 0 Times in 0 Posts
Default

not to my knowledge. If I did, how could I change it?
Reply With Quote
  #6  
Old 1st April 2010, 15:08
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,711
Thanks: 1,900
Thanked 2,702 Times in 2,545 Posts
Default

http://www.howtoforge.com/setting-ch...root-passwords
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 1st April 2010, 16:37
carlosinfl carlosinfl is offline
Member
 
Join Date: Dec 2009
Location: Orlando, FL
Posts: 70
Thanks: 3
Thanked 3 Times in 3 Posts
Send a message via AIM to carlosinfl
Default

I think I know the issue.

You should connect to MySQL from your Fedora machine and check some settings before connecting remotely. You should also check and see if Fedora has this file:

/usr/bin/mysql_secure_installation

If you have that file noted above, please please please run it. Even if you already installed MySQL, it basically secures your pre-existing install. It helps you set a password for 'root'@'localhost' & asks if you want to allow remote logins for 'root'@'server1.example.com'. Also it removes the 'anonymous' accounts (recommended).

If you don't have it, no big deal. You can do everything noted above manually via MySQL.

From your Fedora machine:

1. Log in as root: mysql -u root -p
2. Create a super user because using root is not recommended:

Code:
mysql> CREATE USER 'riff'@'localhost' IDENTIFIED BY ('password');
GRANT ALL PRIVILEGES ON *.* TO 'riff'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
What you did above was create a new user called 'riff' and then you gave him the same access as root so he can do whatever he needs. Now you don't need to use 'root' anymore. You need to understand that when you create 'riff'@'localhost', this user just like 'root'@'localhost' can only connect to MySQL from the Fedora machine and not remotely. For that you need to create another account 'riff'@'server1.example.com'. Then set a password to that new user and try to connect to MySQL from another server. Make sense?

Check to make sure you don't already have remote accounts:

Code:
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> SELECT user, host FROM user;
+---------+-----------+
| user    | host      |
+---------+-----------+
| carlos  | localhost |
| natalie | localhost |
| root    | localhost |
+---------+-----------+
3 rows in set (0.00 sec)
As you can see from above I only have accounts that login locally from MySQL server. Not remotely. Now check and make sure you don't have any user accounts w/o a set password:

Code:
mysql> SELECT * FROM user WHERE Password="";
Empty set (0.00 sec)
Post your user and hosts tables like I showed you above so we can see why you can't login remotely. Hope this helped you a little...
Reply With Quote
The Following User Says Thank You to carlosinfl For This Useful Post:
Riff (8th April 2010)
  #8  
Old 12th April 2010, 15:31
Riff Riff is offline
Junior Member
 
Join Date: Mar 2010
Location: England
Posts: 22
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Thanks so much for this! I think this is exactly what I need (that said, I've not had a chance to get in and try it out yet)

I'll keep you posted
Reply With Quote
  #9  
Old 12th April 2010, 18:07
carlosinfl carlosinfl is offline
Member
 
Join Date: Dec 2009
Location: Orlando, FL
Posts: 70
Thanks: 3
Thanked 3 Times in 3 Posts
Send a message via AIM to carlosinfl
Default

No problem. Let us know how it works out.
Reply With Quote
  #10  
Old 14th April 2010, 18:13
Riff Riff is offline
Junior Member
 
Join Date: Mar 2010
Location: England
Posts: 22
Thanks: 3
Thanked 0 Times in 0 Posts
 
Default

hi there

ok I've got the file you mention in usr/bin/mysql_secure_installation

I ran it in terminal and got the following error:

Quote:
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!


In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
/usr/bin/mysql_secure_installation: line 68: .my.cnf.12200: Permission denied
/usr/bin/mysql_secure_installation: line 69: .my.cnf.12200: Permission denied
/usr/bin/mysql_secure_installation: line 70: .my.cnf.12200: Permission denied
/usr/bin/mysql_secure_installation: line 72: .my.cnf.12200: Permission denied
/usr/bin/mysql_secure_installation: line 41: .mysql.12200: Permission denied
/usr/bin/mysql_secure_installation: line 43: .mysql.12200: No such file or directory
Enter current password for root (enter for none):
/usr/bin/mysql_secure_installation: line 68: .my.cnf.12200: Permission denied
/usr/bin/mysql_secure_installation: line 69: .my.cnf.12200: Permission denied
/usr/bin/mysql_secure_installation: line 70: .my.cnf.12200: Permission denied
/usr/bin/mysql_secure_installation: line 72: .my.cnf.12200: Permission denied
/usr/bin/mysql_secure_installation: line 41: .mysql.12200: Permission denied
/usr/bin/mysql_secure_installation: line 43: .mysql.12200: No such file or directory
Enter current password for root (enter for none):
I tried the login to mysql and got a password request.

I'm stuck now
Reply With Quote
Reply

Bookmarks

Tags
configuring, fedora 12, lamp, mysql

Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ISPConfig3 Mail Warn Errors reason8 General 3 25th November 2009 13:58
Failed to install libmysql library for MYSQL client dinesh.4126 Server Operation 1 24th September 2009 13:39
MySQL problem satimis Server Operation 5 25th June 2008 15:41
Weird mysql error after trying to install MyDNS :/ pne General 5 29th October 2007 15:44
ISPConfig: Install: mysql: unknown variable 'db-name=default' dreger Installation/Configuration 3 30th July 2006 22:23


All times are GMT +2. The time now is 22:28.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.