Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

mysqld can't start as root (linux)

Posted on 2014-01-26
4
Medium Priority
?
7,609 Views
Last Modified: 2014-01-26
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
0
Comment
Question by:thready
  • 2
4 Comments
 
LVL 24

Accepted Solution

by:
johanntagle earned 2000 total points
ID: 39810644
You didn't describe how you installed your mysql instance, so it's hard to determine where exactly you went wrong.  However, it looks like you are attempting to run mysql with the root user, which is a big no-no.  The specific security section of the manual mentioned in the error message is here:

http://dev.mysql.com/doc/refman/5.5/en/changing-mysql-user.html

Suggest you check it out and start your troubleshooting from there.
0
 
LVL 35

Expert Comment

by:Duncan Roe
ID: 39810711
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
0
 
LVL 35

Expert Comment

by:Duncan Roe
ID: 39810717
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.
0
 
LVL 1

Author Comment

by:thready
ID: 39810720
crap so sorry- i accepted this just as i got your answers.... i got it working...  THanks for your responses!
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month13 days, 1 hour left to enroll

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question