LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 11-29-2004, 10:11 AM   #1
OkiTek
LQ Newbie
 
Registered: Nov 2004
Location: Okinawa Japan
Distribution: Fedora Core 3
Posts: 5

Rep: Reputation: 0
Fedora Core 3, MySql Server, mysql started mysql ended


I'm trying to install and run mysqld

[root@yahoobb220057116128 ~]# uname -r
2.6.9-1.681_FC3
64 bit version
----------------------------
I installed mysql-server with yum and it finished successfully.
Checking to see if things were installed.

[root@yahoobb220057116128 ~]# yum list installed mysql*
Installed Packages
mysql.x86_64 3.23.58-13 installed
mysql-server.x86_64 3.23.58-13 installed
----------------------------
I go to;
Applications > System Settings > Server Settings > Services
Highlight > mysqld > click start,
"mysqld started successfully"
Although in the status it reads
"mysqld dead but subsys locked"
----------------------------
Applications > System Settings > System Logs > Mysql Server Log, reads;
041129 22:53:18 mysqld started
041129 22:53:18 mysqld ended
----------------------------
There is a mysql.sock file in
/var/lib/mysql/mysql.sock
Accessed: Mon 29 Nov 2004 10:53:18 PM JST
----------------------------
There are no files located in the folders
/var/lib/mysql
/var/lib/test

I though yum would create these during the install with /usr/bin/mysql_install_db
----------------------------
/etc/my.cnf reads;
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

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

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
----------------------------
Here are the contents of /etc/init.d
#!/bin/bash
#
# mysqld This shell script takes care of starting and stopping
# the MySQL subsystem (mysqld).
#
# chkconfig: - 64 36
# description: MySQL database server.
# processname: mysqld
# config: /etc/my.cnf
# pidfile: /var/run/mysqld/mysqld.pid

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network


prog="MySQL"

datadir="/var/lib/mysql"

start(){
touch /var/log/mysqld.log
chown mysql:mysql /var/log/mysqld.log
chmod 0640 /var/log/mysqld.log
if [ ! -d $datadir/mysql ] ; then
action $"Initializing MySQL database: " /usr/bin/mysql_install_db
ret=$?
chown -R mysql:mysql $datadir
if [ $ret -ne 0 ] ; then
return $ret;
fi
fi
chown -R mysql:mysql $datadir
chmod 0755 $datadir
/usr/bin/safe_mysqld --defaults-file=/etc/my.cnf >/dev/null 2>&1 &
ret=$?
# If you've removed anonymous users, this line must be changed to
# use a user that is allowed to ping mysqld.
ping="/usr/bin/mysqladmin -uUNKNOWN_MYSQL_USER ping"
# Spin for a maximum of ten seconds waiting for the server to come up
if [ $ret -eq 0 ]; then
for x in 1 2 3 4 5 6 7 8 9 10; do
if [ -n "`$ping 2> /dev/null`" ]; then
break;
else
sleep 1;
fi
done
if !([ -n "`$ping 2> /dev/null`" ]); then
echo "Timeout error occurred trying to start MySQL Daemon."
action $"Starting $prog: " /bin/false
else
action $"Starting $prog: " /bin/true
fi
else
action $"Starting $prog: " /bin/false
fi
[ $ret -eq 0 ] && touch /var/lock/subsys/mysqld
return $ret
}

stop(){
/bin/kill `cat /var/run/mysqld/mysqld.pid 2> /dev/null ` > /dev/null 2>&1
ret=$?
if [ $ret -eq 0 ]; then
action $"Stopping $prog: " /bin/true
else
action $"Stopping $prog: " /bin/false
fi
[ $ret -eq 0 ] && rm -f /var/lock/subsys/mysqld
[ $ret -eq 0 ] && rm -f $datadir/mysql.sock
return $ret
}

restart(){
stop
sleep 2
start
}

condrestart(){
[ -e /var/lock/subsys/mysqld ] && restart || :
}

# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status mysqld
;;
restart)
restart
;;
condrestart)
condrestart
;;
*)
echo $"Usage: $0 {start|stop|status|condrestart|restart}"
exit 1
esac

exit $?
----------------------------
I read in a few other threads to change the user who pings, in the above script,
I tried changing it to user mysql and nobody then I try as root from terminal;

[root@yahoobb220057116128 ~]# mysqladmin ping
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
----------------------------
or if there is a sock file error;
----------------------------
[root@yahoobb220057116128 ~]# mysqladmin ping
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
[root@yahoobb220057116128 ~]#
----------------------------
I am sure this all has something to do with no mysql databases created in /var/lib/mysql/*, so I run

[root@yahoobb220057116128 ~]# mysql_install_db
Preparing db table
Preparing host table
Preparing user table
Preparing func table
Preparing tables_priv table
Preparing columns_priv table
Installing all prepared tables

To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
This is done with:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h yahoobb220057116128.bbtec.net password 'new-password'
See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/safe_mysqld &

You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; run-all-tests

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

The latest information about MySQL is available on the web at
htp://ww.mysql.com
Support MySQL by buying support/licenses at htps://order.mysql.com
----------------------------
Still no databases in /var/lib/mysql/*
Is there more to the install than just installing with yum, starting, then connecting?
I keep chasing my tail with this, all guidance is greatly appreciated,
Best Regards,
Jason
 
Old 12-12-2004, 09:55 PM   #2
the_tflk
Member
 
Registered: Jul 2003
Location: MA
Distribution: Ubuntu
Posts: 35

Rep: Reputation: 16
I am having many of the same problems - I read your post with growing hope, telling myself 'surely someone who had posted so eloquently will have gotten a learned response!' Have you found a solution to this problem?
 
Old 12-13-2004, 01:03 AM   #3
OkiTek
LQ Newbie
 
Registered: Nov 2004
Location: Okinawa Japan
Distribution: Fedora Core 3
Posts: 5

Original Poster
Rep: Reputation: 0
I ditched Fedora 3, and Installed Suse 9.1

I then followed the isntructions from the suse site Installing MySQL
http://www.novell.com/coolsolutions/..._linux_nw.html
I don't have specifics for Fedora, since I gave up that quest.

I think one of my problem with installing MySQL is that it tries to resolve your hostname before installing. Do your computers have a Fully Qualified Domain Names? if not as root in a terminal window type

hostname localhost

this sets your hostname to localhost, temporarily, it will revert back after a reboot, unless your make the change permanent in /etc/host file

Then try to install mysql again.

Jason
 
Old 12-13-2004, 07:45 AM   #4
the_tflk
Member
 
Registered: Jul 2003
Location: MA
Distribution: Ubuntu
Posts: 35

Rep: Reputation: 16
Thanks, I'll try that and post back whether or not that worked for me - off to work I go.
 
Old 12-17-2004, 12:03 PM   #5
cormander
Member
 
Registered: Dec 2004
Location: Hawaii
Distribution: Fedora & CentOS
Posts: 72

Rep: Reputation: 15
Is mysql running?

service mysqld status

because it doesn't start automatically after install.

service mysqld start

It should initilize the db during your first startup. From there you can access the mysql server.

If you don't have the "mysqld" service, make sure you have mysql-server rpm installed

-Corey
 
Old 12-17-2004, 03:31 PM   #6
anthony1101
Member
 
Registered: Aug 2004
Location: Texas
Distribution: FC3
Posts: 59

Rep: Reputation: 15
I have the same kinds of issues but with the following exepctions.

I am trying to install on Fedora Core 3 (FC3 for all the search terms) and MySQL 4.1.8-0. I run into the same issue if compiling on my own or installing from the RPM. MySQL starts and then abruptly stops.

Nothing in the /var/log/mysqld.log other than
041217 14:02:27 mysql started
041217 14:02:27 mysql ended

I have been going over the manual but have not been able to find anything else other than to turn DEBUG on but that does not seem to be helping. Is 041217 an error code?

Any help would be greatly appreciated.
 
Old 12-17-2004, 04:26 PM   #7
cormander
Member
 
Registered: Dec 2004
Location: Hawaii
Distribution: Fedora & CentOS
Posts: 72

Rep: Reputation: 15
You might want to consider installing gdb ( GNU Debugger ) and running the mysql daemon from there, to see if it is segfaulting or something.

Code:
[root@localhost corman]# gdb /usr/libexec/mysqld
GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...(no debugging symbols found)...
(gdb)
At the gdb prompt, type "run" and press enter. Let me know what output you get.

-Corey
 
Old 12-17-2004, 04:46 PM   #8
anthony1101
Member
 
Registered: Aug 2004
Location: Texas
Distribution: FC3
Posts: 59

Rep: Reputation: 15
Ok..I am downloading now GDB 6.2 and will let you know what I find in a few minutes.
 
Old 12-17-2004, 05:43 PM   #9
anthony1101
Member
 
Registered: Aug 2004
Location: Texas
Distribution: FC3
Posts: 59

Rep: Reputation: 15
Ok...here is what I found
Starting program: /usr/local/libexec/mysqld
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread -151103168 (LWP 14449)]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
041217 16:42:59 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!

041217 16:42:59 [ERROR] Aborting

041217 16:42:59 [Note] /usr/local/libexec/mysqld: Shutdown complete


Program exited with code 01.
 
Old 12-17-2004, 06:00 PM   #10
cormander
Member
 
Registered: Dec 2004
Location: Hawaii
Distribution: Fedora & CentOS
Posts: 72

Rep: Reputation: 15
Hmm. Try it again, this time from the prompt type:

Code:
 run --user=mysql
-Corey
 
Old 12-17-2004, 06:31 PM   #11
anthony1101
Member
 
Registered: Aug 2004
Location: Texas
Distribution: FC3
Posts: 59

Rep: Reputation: 15
Ok...I think I am getting somewhere.

Here is the output.
gdb) run --user=mysql
Starting program: /usr/local/libexec/mysqld --user=mysql
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...[Thread debugging using libthread_db enabled]
[New Thread -151103168 (LWP 14510)]
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...[New Thread -159499344 (LWP 14513)]
041217 17:14:19 [Warning] mysql.user table is not updated to new password format; Disabling new password usage until mysql_fix_privilege_tables is run
041217 17:14:19 [Warning] Can't open and lock time zone table: Table 'mysql.time_zone_leap_second' doesn't exist trying to live without them
/usr/local/libexec/mysqld: ready for connections.
Version: '4.1.8' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution
[New Thread -159704144 (LWP 14539)]
(no debugging symbols found)...(no debugging symbols found)...[Thread -159704144 (zombie) exited]

MySQLD seems to be up and running continuously. (good) however when trying to correct the password format I get the following output (bad!) and cannot seem to get all of the file location issues worked out. Seems that a number of updates have been made to the code file locations and not updated in the docs. Frustrating!!!

# mysql_fix_privilege_tables
This script updates all the mysql privilege tables to be usable by
MySQL 4.0 and above.

This is needed if you want to use the new GRANT functions,
CREATE AGGREGATE FUNCTION, or the more secure passwords in 4.1

You can safely ignore all 'Duplicate column' and 'Unknown column' errors
because these just mean that your tables are already up to date.
This script is safe to run even if your tables are already up to date!

/usr/bin/mysql_fix_privilege_tables: line 185: /usr/bin/mysql: No such file or directory
Got a failure from command:
/usr/bin/mysql --no-defaults --force --user=root --host=localhost --database=mysql
Please check the above output and try again.

If you get an 'Access denied' error, you should run this script again and
give the MySQL root user password as an argument with the --password= option
 
Old 12-17-2004, 07:51 PM   #12
anthony1101
Member
 
Registered: Aug 2004
Location: Texas
Distribution: FC3
Posts: 59

Rep: Reputation: 15
It is probably worth noting that many of the scripts that are included with the server package rely on the client applications so you should make sure you have both installed. I noticed that I did not!!

-Anthony
 
Old 12-17-2004, 08:19 PM   #13
anthony1101
Member
 
Registered: Aug 2004
Location: Texas
Distribution: FC3
Posts: 59

Rep: Reputation: 15
Man...you just have got to LOVE Linux the way it mimics life. Brief periods of jubilation as you make some headway followed but utter dispair as you realize you are really no closer to you goal than when you started!

Ok...here is where we are now. The old MySQL Administrator (verision 1.0.14) was failing only upon giving the correct logon credentials....now isn't that special. After upgrading to 1.0.17 I was able to see what is going on....but only just barely. Version 17 (like 14) still has an issue with restoring your data (something like the last 4 rows are lost in each table) so I since it is still in alpha I wouldn't recommend using it at the moment for that purpose. However I don't know all of the tasks for creating the new databases via command line, but I am still searching. The manual indicates you can just copy the files over but from my experience its not fully functional either.

NOW...down to the meat of the problems still getting MySQL working correctly. I am currently only able to run the server in debug (gdb). When trying to start mysql via /etc/rc.d/init.d/mysql start I get get the following error: STILL NOTHING! I therefore checked my.cnf file and the user=mysql. For some odd reason I have this feeling that it is acting like the file locations are still not correct, but time and time again I have checked and rechecked and database files appear to be in the correct place with the correct permissions.

I hope this is helping someone out there!
 
Old 12-18-2004, 01:56 AM   #14
anthony1101
Member
 
Registered: Aug 2004
Location: Texas
Distribution: FC3
Posts: 59

Rep: Reputation: 15
Ok just put me into the category of completely tenatious. I have been working on this problem continuiously for the past 16 hours and I am pretty sure that I have few answers now on how to get 4.1 working under FC3. Its all documented, but Whew....what a pain!

There were several issues here..first was restoring a backup copy of data that was copied via the lan onto another machine while the FC2 was torn down and FC3 installed (ie no upgrade). Then it was decided that since no hostname was set up during the install it would be changed. Now...two problems exist. The first is that FC3 comes with MySQL 3.2 and didn't like being upgraded. After completing the upgrade many remanents of the old db security are still left in place. To work around this you can use the following commands (straight from the manual (dev.mysql.com/doc/mysql/en/Adding_users.html) even if you aren't adding users. If you are new to myslq command line, notice the semicolon at the end of the command.

mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost'
-> IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%'
-> IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
mysql> GRANT RELOAD,PROCESS ON *.* TO 'admin'@'localhost';
mysql> GRANT USAGE ON *.* TO 'dummy'@'localhost';

Having trouble getting /usr/local/libexec/mysql -p to let you in? Well..that probably is a follow on from the name change. See, in order to change the hostname you simply cannot change the /etc/hostname (or create one if it doesn't exist). You also need to make the changes in your network configuration files. Even if you think you have it right you may want to go ahead and specifiy the account (ex /usr/local/libexec/mysql -u usrname -p dbname) where username is the name that has access and dbname is the name of the database.

Now...since you are going to be copying your files back over and replacing the existing ones you are going to want to check that the file permissions are correct. Of course most will want to do this with chmod, however since your dbfiles are tied to an account you want to do a chown. Specify the account in chown that you just set up when you connected to the mysql command line.

Hope that helps!
 
Old 12-18-2004, 11:10 AM   #15
anthony1101
Member
 
Registered: Aug 2004
Location: Texas
Distribution: FC3
Posts: 59

Rep: Reputation: 15
Hmm...I still cannot seem to get /etc/rc.d/init.d/mysql start or /etc/init.d/mysql start to function even though /usr/local/libexec/mysql works fine Any suggestions there?
 
  


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
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. NoviceW Linux - Networking 17 09-17-2014 03:13 PM
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock welery Linux - Software 19 03-06-2014 08:19 AM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. suziecorbett Linux - Software 8 10-09-2008 02:52 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 09:44 AM
Too many MySQL daemons started: Fedora casey0999 Linux - Software 3 09-24-2004 04:32 PM


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