You are not logged in.

#1 2012-05-26 05:09:02

xorgx3
Member
From: Poland
Registered: 2011-11-29
Posts: 197

[SOLVED]Cannot install mysql correctly

Hi
If i try install mysql I get this errror:

chown: invalid user: 'mysql'
Cannot change ownership of the database directories to the 'mysql'
user.  Check that you have the necessary permissions and try again.
error: command failed to execute correctly
Optional dependencies for mysql
    perl-dbi
    perl-dbd-mysql

Do i have to user called "mysql"? How can I install this package correctly?

Last edited by xorgx3 (2012-05-28 10:21:02)

Offline

#2 2012-05-26 05:17:34

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED]Cannot install mysql correctly

Are you following the wiki instructions?

If so, where is this failure ocurring?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2012-05-26 06:19:09

xorgx3
Member
From: Poland
Registered: 2011-11-29
Posts: 197

Re: [SOLVED]Cannot install mysql correctly

Error occurring during installation.This is full installation log:

[2012-05-26 07:06] Running 'pacman -S mysql'
[2012-05-26 07:06] chown: invalid user: 'mysql'
[2012-05-26 07:06] Cannot change ownership of the database directories to the 'mysql'
[2012-05-26 07:06] user.  Check that you have the necessary permissions and try again.
[2012-05-26 07:06] installed mysql (5.5.24-1)

Although mysqld is installed i can't run daemon (still report fail).

Offline

#4 2012-05-26 12:11:10

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: [SOLVED]Cannot install mysql correctly

Have you actually checked what it's complaining about (directory permissions)? The exact directories you should check are in the wiki article jasonwryan linked.


Burninate!

Offline

#5 2012-05-26 12:27:30

xorgx3
Member
From: Poland
Registered: 2011-11-29
Posts: 197

Re: [SOLVED]Cannot install mysql correctly

If i did

chmod 777 /var/lib/mysql

i had error :

warning: directory permissions differ on var/lib/mysql/
filesystem: 777  package: 700

If i changed permissions (chmod 700 /var/lib/mysql) package not report error, but mysql still not working.
For example:

# mysqladmin -u root password
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!

httpd daemon is running at this time.

Offline

#6 2012-05-26 13:27:53

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: [SOLVED]Cannot install mysql correctly

If your mysql daemon isn't running, then mysqladmin won't be able to establish a connection to it obviously.

What happens if you try to start the daemon after fixing the permissions (/etc/rc.d/mysqld start). Also check the mysql logs in /var/log should it fail.


Burninate!

Offline

#7 2012-05-26 13:31:51

Cdh
Member
Registered: 2009-02-03
Posts: 1,098

Re: [SOLVED]Cannot install mysql correctly

chown: invalid user: 'mysql'

That's probably the problem.

Do you get this?

 % grep mysql /etc/passwd
mysql:x:89:89::/var/lib/mysql:/bin/false

If not, try adding that line.


฿ 18PRsqbZCrwPUrVnJe1BZvza7bwSDbpxZz

Offline

#8 2012-05-26 14:43:22

xorgx3
Member
From: Poland
Registered: 2011-11-29
Posts: 197

Re: [SOLVED]Cannot install mysql correctly

What happens if you try to start the daemon after fixing the permissions (/etc/rc.d/mysqld start). Also check the mysql logs in /var/log should it fail.

If I try running daemon after fixing permissions still I see

/etc/rc.d/mysqld start
:: Starting MySQL Server                                                [BUSY] 
                                                                        [FAIL] 




Do you get this?
 % grep mysql /etc/passwd
mysql:x:89:89::/var/lib/mysql:/bin/false
If not, try adding that line.

Where I have to add that line?
grep not shows anything.

Last edited by xorgx3 (2012-05-26 14:43:33)

Offline

#9 2012-05-26 20:26:49

Cdh
Member
Registered: 2009-02-03
Posts: 1,098

Re: [SOLVED]Cannot install mysql correctly

Well, mysql runs under the user called mysql. If it is not in /etc/passwd the user doesn't exist...

I had a quick look at the install script of mysql, it creates a group, a user and sets up mysql:

post_install(){
  groupadd -g 89 mysql &>/dev/null
  useradd -u 89 -g mysql -d /var/lib/mysql -s /bin/false mysql &>/dev/null
  usr/bin/mysql_install_db --user=mysql --basedir=/usr
  chown -R mysql:mysql var/lib/mysql &>/dev/null
}

I would suggest just removing the mysql package with pacman -Rnc mysql and installing it again to set it up properly...


฿ 18PRsqbZCrwPUrVnJe1BZvza7bwSDbpxZz

Offline

#10 2012-05-27 09:52:25

xorgx3
Member
From: Poland
Registered: 2011-11-29
Posts: 197

Re: [SOLVED]Cannot install mysql correctly

OK I probably know where is the problem, I saw this just now. It isn't connected with mysql exactly.
So, if i try create new group/user or run new daemon I have to using full path (/usr/sbin/useradd instead of useradd, /etc/rc.d/somethin start instead of rc.d start something).
I think I have to fix this problem and later install mysql correctly.
So, somebody know how fix this?

Offline

#11 2012-05-27 10:30:00

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,538

Re: [SOLVED]Cannot install mysql correctly

echo $PATH

Offline

#12 2012-05-27 11:14:23

xorgx3
Member
From: Poland
Registered: 2011-11-29
Posts: 197

Re: [SOLVED]Cannot install mysql correctly

$ echo $PATH
/bin:/usr/bin:/usr/local/bin

What next? I have to change this path?

Offline

#13 2012-05-27 21:52:41

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: [SOLVED]Cannot install mysql correctly

xorgx3 wrote:
$ echo $PATH
/bin:/usr/bin:/usr/local/bin

What next? I have to change this path?

https://wiki.archlinux.org/index.php/En … _Variables


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#14 2012-05-28 07:47:44

xorgx3
Member
From: Poland
Registered: 2011-11-29
Posts: 197

Re: [SOLVED]Cannot install mysql correctly

I still don't understand how fix them.
My /etc/profile:

# /etc/profile

#Set our umask
umask 022

# Set our default path
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"
export PATH

# Load profiles from /etc/profile.d
if test -d /etc/profile.d/; then
	for profile in /etc/profile.d/*.sh; do
		test -r "$profile" && . "$profile"
	done
	unset profile
fi

# Source global bash config
if test "$PS1" && test "$BASH" && test -r /etc/bash.bashrc; then
	. /etc/bash.bashrc
fi

# Termcap is outdated, old, and crusty, kill it.
unset TERMCAP

# Man is much better than us at figuring this out
unset MANPATH

I think /usr/sbin is my default path.

Offline

#15 2012-05-28 07:56:04

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED]Cannot install mysql correctly

xorgx3 wrote:
$ echo $PATH
/bin:/usr/bin:/usr/local/bin
xorgx3 wrote:

I think /usr/sbin is my default path.


How did you arrive at that conclusion.

If you look at what should be your $PATH in /etc/profile and look at what is your $PATH, you can see that you are missing the majority of it. Somewhere along the way (your shell initialization files, your login manager maybe) something is b0rked...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#16 2012-05-28 08:29:40

xorgx3
Member
From: Poland
Registered: 2011-11-29
Posts: 197

Re: [SOLVED]Cannot install mysql correctly

OK, so I think the easiest way would be remove this topic and start a new, because I don't know how fix it myself, and I hope someone else will help me.

Offline

#17 2012-05-28 08:34:16

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: [SOLVED]Cannot install mysql correctly

For temporarily fixing your path, just run:

export PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"

EDIT: typo

Last edited by Gcool (2012-05-28 08:37:08)


Burninate!

Offline

#18 2012-05-28 08:44:30

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,538

Re: [SOLVED]Cannot install mysql correctly

Do you use slim?  If yes, what is the value of default_path in slim.conf?

Offline

#19 2012-05-28 10:19:46

xorgx3
Member
From: Poland
Registered: 2011-11-29
Posts: 197

Re: [SOLVED]Cannot install mysql correctly

Gcool - thanks for temporarily fixing, it works. But I need permanently fix smile

This topic is solved, I moved discuss here

Offline

Board footer

Powered by FluxBB