Fedora Core 3, MySql Server, mysql started mysql ended
FedoraThis forum is for the discussion of the Fedora Project.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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
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
}
# 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
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?
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
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?
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.
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!
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
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!!
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.
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.
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.