LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-10-2003, 11:18 PM   #1
MaMatO
LQ Newbie
 
Registered: Mar 2003
Location: Jakarta
Distribution: Debian, Fedora Core, Ubuntu, Slackware, Mandrake, Xandros, Knoppix
Posts: 11

Rep: Reputation: 0
Question MySQL in SlackWare


Hello all, I've got a problem with mysql 4 in my Slack machine..
I've installed mysql in my compie, and the process is fine... But when I type mysql in shell, i found that the mysqld hasn't been run... ???? When I execute the mysqld, it prompts a while and ENDED !!!! I can't use mysql ... Please Help Me...
 
Old 09-10-2003, 11:54 PM   #2
Robert0380
LQ Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
try:

#safe_mysqld -uroot


i think, i could be dead wrong. i remember there being something to do to get it to work.
 
Old 09-11-2003, 12:51 AM   #3
djbanaan
Member
 
Registered: Aug 2003
Location: Haarlem, The Netherlands
Distribution: Slackware, FreeBSD
Posts: 178

Rep: Reputation: 30
Actually, the command for MySQL 4 would be "mysqld_safe --user=root &". However, running as root is a bad idea and should only be done for testing purposes!
 
Old 09-11-2003, 07:14 AM   #4
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
I'm willing to admit I'm wrong about this, but I don't think it is a bad thing to run mysqld as root. In fact I think most daemons(ssh,ftp,sendmail....) are run as root.

Now running the mysql client as root is a bad idea as you probably have unrestricted access to everything.
 
Old 09-11-2003, 07:24 AM   #5
djbanaan
Member
 
Registered: Aug 2003
Location: Haarlem, The Netherlands
Distribution: Slackware, FreeBSD
Posts: 178

Rep: Reputation: 30
There have been some vulnerabilities in MySQL in the past that would allow mysql users to get root access to the machine if the daemon was run as root. These have been resolved but I still prefer not to run the daemon as root. It's a personal thing, I guess.
 
Old 09-11-2003, 07:33 AM   #6
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Hmm. I didn't know that. Thanks for the tip. So if you don't run the daemon as root do you run it as mysql? Or as a regular user?
 
Old 09-11-2003, 07:43 AM   #7
djbanaan
Member
 
Registered: Aug 2003
Location: Haarlem, The Netherlands
Distribution: Slackware, FreeBSD
Posts: 178

Rep: Reputation: 30
I run it as mysql, which is a user that only has rights to the MySQL data files.
When installing MySQL it's sometimes a bit tricky to get all the permissions right if you don't want to run it as root, but it will allow for a more secure system.

For MaMatO: If you start MySQL and all it gives you is "MySQL ended", a file called <machinename>.err is created in your MySQL data directory. This file contains the exact error messages which will allow you do diagnose the problem more accurately.
Where your data directory is located depends on the way you installed MySQL (Slackware pkg, source, MySQL binary).

Edit: One more thing: In most cases after installation you have to run an initialization script which will create the MySQL system tables and some other important things. It's called "mysql_install_db" if memory serves me. If these tables etc. are not created, you won't be able to run MySQL.

Last edited by djbanaan; 09-11-2003 at 07:50 AM.
 
Old 10-02-2003, 02:53 PM   #8
sauoq
LQ Newbie
 
Registered: Oct 2003
Posts: 1

Rep: Reputation: 0
Quote:
Originally posted by Hangdog42
I'm willing to admit I'm wrong about this, but I don't think it is a bad thing to run mysqld as root. In fact I think most daemons(ssh,ftp,sendmail....) are run as root.

Now running the mysql client as root is a bad idea as you probably have unrestricted access to everything.
Running the daemon as root allows any mysql user with FILE privs to write a file anywhere on the machine.
 
Old 10-02-2003, 05:21 PM   #9
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Also make sure you have the correct user permissions as well after installation and setting up the db and running 'mysql_install_db' then do this:

chown -R mysql.mysql /var/run/mysql
safe_mysqld &

And see if it starts with no problems.
 
Old 10-03-2003, 07:32 AM   #10
tarpat1
LQ Newbie
 
Registered: Dec 2001
Distribution: Slackware
Posts: 3

Rep: Reputation: 0
You can avoid doing that by doing a su mysql and then running mysql_install_db to ensure proper permissions. Then it should run just fine.
 
Old 10-16-2003, 08:21 AM   #11
Randy
LQ Newbie
 
Registered: Jun 2001
Distribution: Redhat
Posts: 18

Rep: Reputation: 0
I am having similar problems. I tried some of the above and it seemed to work, but now when I issue the "show tables" command in the mysql database, I get an error that says:

can't read dir of './mysql' (Err code: 13)

I am running Slackware 9.0 and using MySQL 3.23.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM
Slackware 10 MySQL kdepa Linux - Software 1 01-20-2005 02:13 AM
Slackware 9.1 - Mysql fuelinjection Linux - General 2 06-10-2004 06:26 AM
Slackware + MySQL stuart39 Slackware 5 10-07-2003 03:37 PM
MySQL on slackware hing Slackware 2 01-25-2003 03:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration