Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

mysqld can't start as root (linux)

Posted on 2014-01-26
4
5,738 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 500 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 34

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 34

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

792 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