Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySQL doesn't start on it's own when Linux boots. Help! 2

Status
Not open for further replies.

JustKIDn

MIS
May 6, 2002
386
US
Hi all,

I've looked every where for this.

MySQL doesn't start on it's own when Linux boots.

I have the Caldera OpenLinux and I just upgraded MySQL from 3.22x to 4.0.12 with the rpm.

It never started on it's own with the older version. And I was hoping it would be corrected with the new version.

MySQL is installed correctly and works fine if I start it with mysqld_safe or mysqld.

mysql.server did get installed ok into the /etc/rc.d/init.d directory. But I think there maybe is supposed to be something else. There are no references to mysql in any of the other files or directories under /rc.d and I don't know how to if that's what it takes.

I found the starting and stopping on boot docs on mysql.com. So I know it's mostly configured correctly. They mention a command to run to get it setup to start on boot. But that file doesn't seem to exist on my Linux.

Can you help?

If you need more info, let me know.

Thanks again for the help.

tgus

____________________________
Families can be together forever...
 
No.

Run a
whereis mysql

command before and remove everything manually. Delete my.cnf if still there

Anyway before giving up,

have you checked that all basedir actually match your mysql installation directories? and your my.cnf file?
have you got all frm, MYI, MYD files in /var/lib/mysql or
the program in /usr/bin?

I must admit that I haven't worked with caldera's products, especially because I don't agree with their recent turnaround about the GNU licensing.
I personally run RedHat or Mandrake (which looks the same to me but faster) with no problems ever.

Anyway good luck


Bye

Qatqat

The reason why my girlfriend can read my thoughts is because mine are properly written! (G.Lepore)
 
QatQat,

This is what I have in the /var/lib/mysql directory;

mysql]# ls -lah
total 28M
drwxr-xr-x 4 mysql root 1.0k Apr 23 23:18 .
drwxr-xr-x 12 root root 1.0k Oct 15 2001 ..
-rw-r--r-- 1 mysql root 79k Apr 23 23:18 Linux-svr.kha.err
-rw-rw---- 1 mysql root 95k Apr 23 23:18 Linux-svr.log
-rw-rw---- 1 root root 24k Apr 20 22:44 ib_arch_log_0000000000
-rw-rw---- 1 root root 9.0M Apr 22 23:25 ib_logfile0
-rw-rw---- 1 root root 9.0M Apr 20 22:44 ib_logfile1
-rw-rw---- 1 root root 10M Apr 22 23:25 ibdata1
drwx--x--x 2 mysql root 1.0k Apr 21 00:00 mysql
srwxrwxrwx 1 mysql mysql 0 Apr 23 23:18 mysql.sock
-rw-rw---- 1 mysql root 153 Oct 15 2001 noname.log
drwxr-xr-x 2 mysql root 1.0k Oct 15 2001 test


And this is the /usr/bin directory;

bin]# ls -lah *my*
-rwxr-xr-x 1 root root 1.4k Mar 17 00:35 msql2mysql
-rwxr-xr-x 1 root root 762k Mar 17 00:35 my_print_defaults
-rwxr-xr-x 1 root root 995k Mar 17 00:35 myisamchk
-rwxr-xr-x 1 root root 905k Mar 17 00:35 myisamlog
-rwxr-xr-x 1 root root 928k Mar 17 00:35 myisampack
-rwxr-xr-x 1 root root 876k Mar 17 00:35 mysql
-rwxr-xr-x 1 root root 2.9k Mar 17 00:35 mysql_convert_table_format
-rwxr-xr-x 1 root root 9.9k Mar 17 00:35 mysql_explain_log
-rwxr-xr-x 1 root root 2.6k Mar 17 00:35 mysql_find_rows
-rwxr-xr-x 1 root root 6.7k Mar 17 00:35 mysql_fix_privilege_tables
-rwxr-xr-x 1 root root 14k Mar 17 00:35 mysql_install_db
-rwxr-xr-x 1 root root 6.0k Mar 17 00:35 mysql_secure_installation
-rwxr-xr-x 1 root root 15k Mar 17 00:35 mysql_setpermission
-rwxr-xr-x 1 root root 733k Mar 17 00:35 mysql_waitpid
-rwxr-xr-x 1 root root 3.0k Mar 17 00:35 mysql_zap
-rwxr-xr-x 1 root root 109k Mar 17 00:35 mysqlaccess
-rwxr-xr-x 1 root root 705k Mar 17 00:35 mysqladmin
-rwxr-xr-x 1 root root 732k Mar 17 00:35 mysqlbinlog
-rwxr-xr-x 1 root root 10k Mar 17 00:35 mysqlbug
-rwxr-xr-x 1 root root 702k Mar 17 00:35 mysqlcheck
-rwxr-xr-x 1 root root 18k Mar 17 00:35 mysqld_multi
-rwxr-xr-x 1 root root 9.7k Mar 17 00:35 mysqld_safe
-rwxr-xr-x 1 root root 716k Mar 17 00:35 mysqldump
-rwxr-xr-x 1 root root 28k Mar 17 00:35 mysqlhotcopy
-rwxr-xr-x 1 root root 699k Mar 17 00:35 mysqlimport
-rwxr-xr-x 1 root root 700k Mar 17 00:35 mysqlshow
-rwxr-xr-x 1 root root 734k Mar 17 00:35 mysqltest
lrwxrwxrwx 1 root root 13 Apr 20 17:26 safe_mysqld -> ./mysqld_safe

Do you see anything here that might be suspect?

I haven't heard anything about Caldera/SCO and GNU.

I personally like Suse, but this is a system I setup quite a while ago when I was trying different distros and it seems to work. It is on a low end Pentium and I think Suse requires a little more power.

I don't like the idea that Redhat has perverted KDE and Gnome. And I've always had problems getting it installed right.

Thanks guys. Should I Uninstall now?

tgus

____________________________
Families can be together forever...
 
If I am not mistaken, from your previous posting I gather that your datadir is /var/lib/mysql, therefore in there you have the mysql database with all user/privileges/etc tables.

Did you run the script mysql_install_db?

If not then you don't have all necessary tables in order to start the daemon.


go to /usr/bin


and then run

./mysql_install_db


Try if it works.


Bye

Qatqat



The reason why my girlfriend can read my thoughts is because mine are properly written! (G.Lepore)
 
Yeah, I tried it two or three times before. I just did it again. Here's the results;

bin]# ./mysql_install_db
Installing all prepared tables
030425 16:30:27 /usr/sbin/mysqld: Shutdown Complete


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 Linux-svr.kha 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!

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

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

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

The latest information about MySQL is available on the web at
Support MySQL by buying support/licenses at
And then I tried to start it with mysql_safe &;

bin]# mysqld_safe &
[1] 4803
bin]# Starting mysqld daemon with databases from /var/lib/mysql
030425 16:31:44 mysqld ended


[1]+ Done mysqld_safe
-==================================-

Maybe it got messed up from the original 3.22x install in the distro?

Thanks again!

tgus

____________________________
Families can be together forever...
 
O.K. time to pass out the S T A R S !!! [flip] [flip] [flip] [flip] [flip]

It was your help sleipnir and QatQat that made it possible.

Here's how I did it;

My first clue was the mysql.server file. When I viewed inside, I saw references to safe_mysql. (version 4.0 uses mysql_safe)

So I decided to get rid of mysql and start over. QatQat said I should do a manual delete of mysql, instead of using RPM do uninstall it. I don't know why. He said to type whereis mysql and it showed me three locations.

I decided to go delete the data first. (this was all test stuff so I didn't care about it).
So I went to /var/lib and typed ls -la *my* and there I saw all of my data files.

Next, I typed pwd because I wanted to be sure of what dir I was in (I wanted to be very careful because my old boss typed rm -r *.* from the / directory logged in as root on a production server with HP-UX. And I didn't want to make that mistake!)

So then, after I was sure of what dir I was in, I typed (don't do this!!!) rm * and promptly deleted all the files in the /var/lib dir.

I made a BooBoo!

I hope that doesn't hurt too much! Does anyone know what files are usually in the /var/lib dir?
I immedietly typed umount /var but it wasn't until much later that I found out that I can't unmount /var. So therefore I can't undelete those files.

Then I changed to /var/lib/mysql dir and typed rm -ivr * (see, I'm getting smarter!)

Then I found the 4.0 version of mysql.server here /usr/share/mysql/mysql.server (maybe if I had found this one sooner, I could have avoided all of this!?!)

I then went around and deleted most of the mysql stuff I could find. I didn't bother with the sql-bench stuff and some other minor things. I did save the my.cnf file though.

Next I tried to install; rpm -vhi MySQL-client-4.0.12-0.i386.rpm but it said it was already installed ??? I finally settled on this rpm -vi --force MySQL-client-4.0.12-0.i386.rpm and then rpm -vi --force MySQL-server-4.0.12-0.i386.rpm.

I ran the script mysql_install_db and then I copied in my.cnf to /etc/my.cnf.

Next, I copied mysql.server from /usr/share/mysql/mysql.server to /etc/rc.d/init.d/mysql.server and then changed to /etc/rc.d/rc3.d and ran; ln -sv ../init.d/mysql.server S99mysql and then in /etc/rc.d/rc0.d I ran; ln -sv ../init.d/mysql.server K01mysql (the first one is to start, the other one is to stop)

shutdown -r now and when it came back up I logged in and ran ps -A|more and found that mysql still didn't start. I verified that mysql still worked ok. Then I changed to /etc/rc.d/rc5.d and ran; ln -sv ../init.d/mysql.server S99mysql (because sleipnir mentioned that if I was starting Linux in GUI mode, then it might need to go into rc5.d, he was right!)

That's all it takes to get MySQL to start as a daemon on a Caldera OpenLinux Computer!

Thanks guys. Have a star on me! [flip] [flip] [flip] [flip] [flip]

I really learned a lot doing this. Now I can try to install php4.x! Wish me luck!!!

tgus

____________________________
Families can be together forever...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top