LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices

Reply
 
Search this Thread
Old 02-25-2005, 11:10 AM   #1
tones
LQ Newbie
 
Registered: Feb 2005
Posts: 4

Rep: Reputation: 0
MySQL 4.1 & Fedora Core 3


I want to install MySQL 4.1 on my Fedora Core 3 box, so I removed any MySQL installation already existing (3.23) and installed the 4.1.10 RPMś obtained from **www,mysql,com***. (Sorry about the url but I have not the 5 required posts to include urls in this post)

My problem is this: when I attempt to run mysql I recieve:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Googling this error I discover there are plenty of problems with installing MySQL 4.1 on FC3 or at least plenty of people are experiencing difficulties with such an task.

So I decide to uninstall this version of MySQL: > rpm -qa|grep -i MySQL tells me that

MySQL-server-4.1.10-0
MySQL-shared-compat-4.1.10-0
MySQL-devel-4.1.10-0
MySQL-client-4.1.10-0

are installed. So, I try > rpm -e MySQL-server-4.1.10-0.i386.rpm to erase MySQL server, but I am told...

error: package MySQL-server-4.1.10-0.i386.rpm is not installed

Now, I am confused a little. Trying > rpm -i MySQL-server-4.1.10-0.i386.rpm I am informed:

warning: MySQL-server-4.1.10-0.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
package MySQL-server-4.1.10-0 is already installed

So, I have the FC3 package installer telling me two totally contradictory things.

Apparently, it is possible to install MySQL on FC3 if **http-->www,whoopis,com/howtos/php5-mysql4-FC3-rpm,html**
is to be believed. (Sorry about the url once again)

At present I cannot uninstall MySQL or re-install it. I am at a loss of what to do. This little penguin lover is completely baffled.

Needless to say I have wasted many hours attempting to resolve this problem. To date these hours have produced nothing approaching a solution. I would very much appreciate any help anybody might be able to provide on this issue as it would greatly facilitate my desire to get some sleep....

 
Old 02-26-2005, 03:22 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
ok, your problem is more than likely to be that you've not started the mysql service (/etc/init.d/mysql start).

as for the rpm things... very common mistake.

the FILE = MySQL-server-4.1.10-0.i386.rpm
the PACKAGE = MySQL-server

you need to uninstall the PACKAGE, as the FILE is only what arbitrarily contains it....
 
Old 02-27-2005, 09:07 AM   #3
tones
LQ Newbie
 
Registered: Feb 2005
Posts: 4

Original Poster
Rep: Reputation: 0
Ahh..
Thank you very much acid_kewpie. I was able to uninstall MySQL using rpm -e MySQ-server. Regarding your remark that I am probably not running the MySQL demon, it seems you are right, the daemon was not running. I tried one more time installing MySQL 4.1.10 and found myself in exactly the same situation. The package installed and i was told

warning: MySQL-server-4.1.10-0.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h password 'new-password'
See the manual for more instructions.

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com

Starting the server is the problem. When i run /etc/init.d/mysql start the server starts, then stops. Typing tail /var/log/mysqld.log yields

050228 01:21:23 mysqld started
050228 01:21:23 mysqld ended

It seems the daemon just won run. I am continually recieving the following error
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

mysql.sock does not exist on my box. Neither did my.cnf by the way, I made one and placed it in /etc/. Its contents are:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
#set-variable = interactive_timeout=240
#set-variable = wait_timeout=240
#set-variable = max_connections=150
bind-address = 127.0.0.1
skip-name-resolve
safe-show-database

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
log-slow-queries = /var/log/mysql-slow.log

So I kept googling trying to find a solution. I found this bug report https;//bugzilla,redhat,com/bugzilla/show_bug.cgi?id=141062 (again sorry for the url) which pointed out an issue with the mysql_install_db script and SELinux. So, I did the following..

/usr/sbin/setenforce 0
/etc/init.d/mysql start

checking the error log gave this

> tail /var/log/mysqld.log
InnoDB: log sequence number 0 36808.
InnoDB: Doing recovery: scanned up to log sequence number 0 43634
050228 1:37:15 InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
050228 1:37:15 InnoDB: Flushing modified pages from the buffer pool...
050228 1:37:15 InnoDB: Started; log sequence number 0 43634
050228 1:37:16 [ERROR] Fatal error: Can't open privilege tables: Table 'mysql.host' doesn't exist
050228 01:37:16 mysqld ended

Now I thought running the mysql_install_db script here might be helpful, so I did. It told me the usual stuff.. in particular that I could start the server with cd / ; /usr/bin/mysqld_safe & which resulted in
[1] 5029
root@LONIN:/ > Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/run/mysqld/mysqld.pid
050228 01:41:04 mysqld ended
[1]+ Done /usr/bin/mysqld_safe

No luck at all it seems.

I must be missing something here. Apparently it is possible to install MySQL 4.1 on FC3, as I have come across people who seemingly have done so. But I have also found dozens of people who are having exactly the same issues as myself - getting a ERROR 2002 and a referral to the missing mysql.sock.

The mysql_install_db script does make the files in /var/lib/mysql/mysql. Attempting to start the MySQL server results in this log entry:

InnoDB: buffer...
050228 1:41:35 InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 0 43634.
InnoDB: Doing recovery: scanned up to log sequence number 0 43634
050228 1:41:35 InnoDB: Flushing modified pages from the buffer pool...
050228 1:41:35 InnoDB: Started; log sequence number 0 43634
050228 1:41:35 [ERROR] /usr/sbin/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
050228 1:41:35 [ERROR] Fatal error: Can't open privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
050228 01:41:35 mysqld ended

which its seems is the same problem referrred to the bug report mentioned above. There is a patch but that only applies to MySQL 3.23... It seems I am buggered. Needless to say I would love to know how those people actually managed to get 4.1 running on FC3. I find SElinux most baffling, and completely frustrating and have not a clue how to fix MySQL in this context. I will continue googling and reading in the hope of finding some more information and post any successes I might discover. If anyone has any further insight into this issue a post into this thread would be much appreciated..

Thanks again acid_kewpie. If others have a similar problem little relief can be found in the MySQL forums outside of the many people registering the same dilemna. FC3 is a whole version behind in their release of MySQL, unfortunatley I am in a position that requires a more up-to-date version. But, as the aforementioned bug report indicates even 3.23 is best with problems in Fedore Core 3. My fingers remain crossed that I will find a solution soon.
 
Old 03-07-2005, 08:24 PM   #4
jpipes
LQ Newbie
 
Registered: Mar 2005
Posts: 5

Rep: Reputation: 0
tones,

Had similar troubles when installing MySQL 4.1 under newer Fedora distros. Figured out it was a permissions issue. More than likely you remembered to chown the /var/lib/mysql directory to the mysql user. However, my big mistake was not chgrp'ing the /var/run directory for the mysql group. Without the mysql group having the ability to write to the /var/run directory, the pid file can't be created, so you'll see the server start up, then immediately shutdown.

tail /var/log/mysqld.log should show you some error to the effect that the pid file could not be created, but that the server started successfully, which is strange, but explains why the server starts and then immeidately stops.

To fix the problem, the following worked for me. Let me know if it works for you:

Code:
# cd /var/run
run # chgrp mysql .
Cheers,

Jay
 
Old 03-09-2005, 05:58 PM   #5
ggduff
LQ Newbie
 
Registered: Mar 2005
Posts: 9

Rep: Reputation: 0
I'm having the exact same problems installing MySQL 4.1.10 on FC3. I have tried a manual install from source, a binary install and RPM. I'm no linux expert by any means but I'm great at following instructions which is what I've done. I'm about ready to give up on Fedora
 
Old 03-09-2005, 06:49 PM   #6
jpipes
LQ Newbie
 
Registered: Mar 2005
Posts: 5

Rep: Reputation: 0
Quote:
Originally posted by ggduff
I'm having the exact same problems installing MySQL 4.1.10 on FC3. I have tried a manual install from source, a binary install and RPM. I'm no linux expert by any means but I'm great at following instructions which is what I've done. I'm about ready to give up on Fedora
Almost guarantee it's a permissions issue. What's your my.cnf look like?
 
Old 03-09-2005, 06:59 PM   #7
ggduff
LQ Newbie
 
Registered: Mar 2005
Posts: 9

Rep: Reputation: 0
Here it is (/etc/my.cnf):

# Example MySQL config file for medium systems.
#
# This is for a system with little memory (32M - 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#
# You can copy this file to
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is /usr/local/mysql/var) or
# ~/.my.cnf to set user-specific options.
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.

# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
user = mysql

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking

# Replication Master Server (default)
# binary logging is required for replication
log-bin

# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id = 1

# Replication Slave (comment out master section to use this)
#
# To configure this host as a replication slave, you can choose between
# two methods :
#
# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
# the syntax is:
#
# CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
# MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
#
# where you replace <host>, <user>, <password> by quoted strings and
# <port> by the master's port number (3306 by default).
#
# Example:
#
# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
# MASTER_USER='joe', MASTER_PASSWORD='secret';
#
# OR
#
# 2) Set the variables below. However, in case you choose this method, then
# start replication for the first time (even unsuccessfully, for example
# if you mistyped the password in master-password and the slave fails to
# connect), the slave will create a master.info file, and any later
# change in this file to the variables' values below will be ignored and
# overridden by the content of the master.info file, unless you shutdown
# the slave server, delete master.info and restart the slaver server.
# For that reason, you may want to leave the lines below untouched
# (commented) and instead use CHANGE MASTER TO (see above)
#
# required unique id between 2 and 2^32 - 1
# (and different from the master)
# defaults to 2 if master-host is set
# but will not function as a slave if omitted
#server-id = 2
#
# The replication master for this slave - required
#master-host = <hostname>
#
# The username the slave will use for authentication when connecting
# to the master - required
#master-user = <username>
GNU nano 1.2.4 File: /etc/my.cnf

#
# The password the slave will authenticate with when connecting to
# the master - required
#master-password = <password>
#
# The port the master is listening on.
# optional - defaults to 3306
#master-port = <port>
#
# binary logging - not required for slaves, but recommended
#log-bin

# Point the following paths to different dedicated disks
#tmpdir = /tmp/
#log-update = /path-to-dedicated-directory/hostname

# Uncomment the following if you are using BDB tables
#bdb_cache_size = 4M
#bdb_max_lock = 10000

# Uncomment the following if you are using InnoDB tables
innodb_data_home_dir = /usr/local/mysql/var/
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /usr/local/mysql/var/
innodb_log_arch_dir = /usr/local/mysql/var/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
innodb_buffer_pool_size = 16M
innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout
 
Old 03-09-2005, 07:24 PM   #8
jpipes
LQ Newbie
 
Registered: Mar 2005
Posts: 5

Rep: Reputation: 0
For some reason, on FC3 the /usr/local/share/mysql.server script that you copy to your /etc/init.d directory overrides the /tmp/mysql.sock value with a command line --sock=/var/lib/mysql/mysql.sock (at least, it did on my machine)

You may want to double check that you've:

#> chgrp mysql /var/lib/mysql
#> chgrp mysql /var/run

Because the pid file gets dumped into /var/run/mysql/localhost.localdomain.pid

See if that works.

Pretty much check that ANY directory that the mysqld server uses (/var/lib/mysql /var/run /usr/local /usr/local/lib has either group ownership, or write permissions in the directory.

I had a bunch of trouble with assigning the correct permissions because, for some dumb reason, I didn't do a ./configure with a --prefix directive, so for FC3, it spread the files all over the filesystem... so it's been a pain tracking down all the directories and files that the server uses...

Good luck, but just feel confident that someone actually has it working...on a laptop no less.

BTW, I have SELinux disabled, though I don't think this means much in this case.

Last edited by jpipes; 03-09-2005 at 07:26 PM.
 
Old 03-12-2005, 06:23 AM   #9
ggduff
LQ Newbie
 
Registered: Mar 2005
Posts: 9

Rep: Reputation: 0
Ok, I set file permissions and/or tried changing group ownership everywhere I could think of and tried install again:
Code:
[root@localhost ~]# rpm -ivf MySQL-server-4.1.10-0.i386.rpm 
warning: MySQL-server-4.1.10-0.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
Preparing packages for installation...
MySQL-server-4.1.10-0
050312  7:19:15 [Warning] Asked for 196608 thread stack, but got 126976
050312  7:19:15 [Warning] Asked for 196608 thread stack, but got 126976
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'
See the manual for more instructions.

NOTE:  If you are upgrading from a MySQL <= 3.22.10 you should run
the /usr/bin/mysql_fix_privilege_tables. Otherwise you will not be
able to use the new GRANT command!

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at https://order.mysql.com
So now the mysqld is running, but there is no mysql or mysqladmin at /usr/bin/ or anywhere else.

What could I possibly be missing here?
 
Old 03-13-2005, 09:40 AM   #10
jpipes
LQ Newbie
 
Registered: Mar 2005
Posts: 5

Rep: Reputation: 0
Do:

#> updatedb
#> locate mysql

You see no client or administrative tools installed?

What directory did you install MySQL under? Meaning, did you use --prefix= configure option?

Only thing I could suggest is uninstalling it and installing from source. Bit more complicated, but you have complete control over the install process.

Let me know,

Jay
 
Old 03-13-2005, 10:30 AM   #11
ggduff
LQ Newbie
 
Registered: Mar 2005
Posts: 9

Rep: Reputation: 0
The installation that I was referring to in the posts above was an rpm install, therefore not allowing a custom install.

However, at precisely 1:00am last night I made a breakthrough!

It turns out that you were correct - it did have something to do with file permissions, but I fixed it by manually adding a directory. Thanks for pointing me in the right direction.

I went for a binary install as opposed to the rpm that wasn't giving me any clues.

So, still no luck after several attempts, but I did manage to get a little farther in that an error log was able to be generated with the binary install:

In looking at my error log in /usr/local/mysql/data/localhost.localdomain.err I found that it was trying to create a file in a non-existant directory:
Code:
050312 22:32:52  mysqld started
050312 22:32:52  InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
InnoDB: File name /usr/local/mysql/var/ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
050312 22:32:52  mysqld ended
So I created the directory and bingo!

So........ to all who might be having a problem with MySQL rpm install on FC3 I suggest trying a binary install using the official documentation instructions, but don't forget to create your var directory and set your file permissions.
 
Old 03-13-2005, 12:44 PM   #12
jpipes
LQ Newbie
 
Registered: Mar 2005
Posts: 5

Rep: Reputation: 0
Congrats on figuring it all out.
 
Old 04-01-2005, 01:26 PM   #13
MrMoke
LQ Newbie
 
Registered: Sep 2003
Location: Austin, TX
Distribution: RedHat & Fedora3
Posts: 13

Rep: Reputation: 0
Hi Guys- I was so happy to find this thread. I was getting extremely frustrated for exactly the same reasons as everyone else that's trying to use Fedora and MySQL. I do remember seeing somewhere on the MySQL site that the RPM's were "built" on SUSE, so I guess we shouldn't expect too much support for Fedora. Has the MySQL team responded to these obvious ownership problems with RPM packages? I know that the src for 4.1.10a is in the development libraries at Fedora, but they probably haven't found time to work on it yet.

Fortunately, I'm just hacking around on a Fedora3 box to get familiar with phpbb, so I can't do much damage that can't be fixed by re-imaging from a backup, but it would be nicer if more people had been through the same things that we are encountering. FWIW, I was having the same problems; missing my.cnf file, inability to start or create passwords, missing directories, missing programs, etc. What a pain!

It actually took longer than I thought to even form a proper google query to lead me here.

Thanks for leading us on the bleeding edge; I guess I better start my binary install now

Last edited by MrMoke; 04-01-2005 at 04:29 PM.
 
Old 04-01-2005, 01:47 PM   #14
ggduff
LQ Newbie
 
Registered: Mar 2005
Posts: 9

Rep: Reputation: 0
'based on SUSE' - ahhhh now I see... and it makes sense with MySQL being developed in Europe, although I would like to see more standardization amongst distros. I'm trying to get Tomcat to install on a Redhat machine but Cpanel doesn't like it... grrrr
 
Old 04-01-2005, 04:43 PM   #15
MrMoke
LQ Newbie
 
Registered: Sep 2003
Location: Austin, TX
Distribution: RedHat & Fedora3
Posts: 13

Rep: Reputation: 0
Hmm- Open Source Distro Standardization. Isn't that an Oxymoron
 
  


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
(FreeBSD && Fedora Core 4 && Slackware 10.0) Filesystem Support taylor_venable *BSD 1 07-14-2005 02:24 PM
MySQL 5.0.3 - Fedora Core 3 Ryand833 Linux - Software 2 03-30-2005 07:34 AM
Fedora Core 3, MySql Server, mysql started mysql ended OkiTek Fedora 30 01-28-2005 09:15 AM
mysql fedora core 2 BeatRyder Linux - Software 9 10-30-2004 10:19 AM
fedora core 1 install -- white screen & mouse & freezes linuxcharlie Fedora - Installation 12 04-27-2004 11:36 AM


All times are GMT -5. The time now is 10:41 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration