Web Hosting Talk







View Full Version : MySQL runs as root, and doesn't start automatically


FiberOptic
08-25-2002, 11:59 AM
I've just configured MySQL on my RaQ550.

Added it in the php.ini file...
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
...

But now I installed phpMyAdmin.
If I don't configure it,
and place it in a directory of a virtual site
I can create databases, see all databases,...
So that's NOT safe for other customers' databases.

It also tells me that mysql runs as root@localhost

When I reboot my server, MySQL doesn't start so I have to start it manually each reboot.

What did I do wrong?

MaB
08-25-2002, 12:10 PM
To start it automatically, you can add a line in /etc/rc.d/rc.local such as:
/etc/rc.d/init.d/mysql(d) restart

I also had some probs with PHPMYADMIN and it wanting to get the root pw... I found older versions were better

FiberOptic
08-25-2002, 12:53 PM
Thanks!

But I don't understand that PHPMyAdmin has "root access" over the databases instead of needing a password for each database he wants to acces...

MaB
08-25-2002, 12:56 PM
That is something i've had problems with in the past too, i use an older version on my servers to get around that

in config.inc.php i set user to root, leave password field blank and then set auth_type to cookie - that asks them for the username/pw

I use v 1.7 (around 2001/08/03)

FiberOptic
08-25-2002, 02:28 PM
Yes,

but if a customer installs phpMyAdmin himself ...
he'll be able to screw up all databases ! :(

MaB
08-25-2002, 03:05 PM
no, if a customer installs it, he still needs the root pw to do anything with all the dbs.

FiberOptic
08-25-2002, 03:41 PM
No!
That's the problem!

Anyone can
create databases
create users
change databases
...

without having to give a password!

blazeman
08-25-2002, 04:07 PM
Then you don't have a root password set in your MySQL database. Set a password and that should solve that issue...

SSH/telnet in and run this on the command line

mysqladmin -u root password 'mynewpassword'

You really should SSH by the way :)

arpetkii
08-25-2002, 05:13 PM
To make MySQL autostart on the 550 just type the following:

mv /etc/rc.d/rc4.d/K90mysql /etc/rc.d/rc4.d/S90mysql
mv /etc/rc.d/rc5.d/K90mysql /etc/rc.d/rc5.d/S90mysql
mv /etc/rc.d/rc3.d/K90mysql /etc/rc.d/rc3.d/S90mysql

That's all.

FiberOptic
08-25-2002, 07:10 PM
Cool

But can you explain how it works...
I mean, I don't understand how that rename of one letter each file can make the raq load it each logon...

blazeman
08-25-2002, 07:19 PM
Easiest way to think of it... things with an S in their name in the /etc/rc.d/rc3.d folder get started on boot (at startup). So think S for start!

Think K for... oh I don't know... I can't think of anything for K :)

FiberOptic
08-25-2002, 07:26 PM
Thanks!

no1v2
08-30-2002, 06:49 AM
K stands for kill :stickout

MultiVol
08-30-2002, 07:41 AM
Originally posted by blazeman
Then you don't have a root password set in your MySQL database. Set a password and that should solve that issue...

SSH/telnet in and run this on the command line

mysqladmin -u root password 'mynewpassword'

You really should SSH by the way :)

ahh.. there you go optic :)

gwaugh
09-01-2002, 01:37 PM
Originally posted by arpetkii
To make MySQL autostart on the 550 just type the following:

mv /etc/rc.d/rc4.d/K90mysql /etc/rc.d/rc4.d/S90mysql
mv /etc/rc.d/rc5.d/K90mysql /etc/rc.d/rc5.d/S90mysql
mv /etc/rc.d/rc3.d/K90mysql /etc/rc.d/rc3.d/S90mysql

That's all.
================================
I prefer chkconfig mysql on
--
gerald