Link to home
Start Free TrialLog in
Avatar of thready
thready

asked on

mysqld can't start as root (linux)

Hi Experts,

I'm running funplug on a NAS drive and want to setup mysqld on it.  I've got it going pretty far, but now when I try to start up with 'mysqld restart' I get the following error:

Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!

fine.  I've got no server running and so I can't create more mysql users.  So how can I get this going from the command line without using mysql?  (chicken & egg?)

Thanks,
Mike
ASKER CERTIFIED SOLUTION
Avatar of johanntagle
johanntagle
Flag of Philippines image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Duncan Roe
First ensure the user mysql is registered. It should have an impossible shell (like /bin/false) and its home directory should be the database repository (at least, I made mine that way, not sure if it's essential). Liek this
09:21:05$ cat /etc/passwd|grep mysql 
mysql:x:27:27:MySQL:/var/lib/mysql:/bin/false

Open in new window

Now you can start mysqld from the root command line with one of the following
mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/run/mysql/mysql.pid &
mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/run/mysql/mysql.pid --skip-networking &

Open in new window

Use --skip-networking if you only want to use the Unix socket. The instructions assume you originally installed the database using the command mysql_install_db --user=mysql
You should have a file called rc.mysqld somewhere under /etc/rc.d. If you cd to the directory containing it, you can issue commands like ./rc.mysqld start, ./rc.mysqld stop and so on.
Avatar of thready
thready

ASKER

crap so sorry- i accepted this just as i got your answers.... i got it working...  THanks for your responses!