You are not logged in.

#1 2011-10-20 16:21:04

thea
Member
Registered: 2006-12-22
Posts: 86

[SOLVED] MySQL re-installation fails

My situation is the following: Am running MySQL successfully on laptop; mistakenly removed successful MySQL installation on main computer (Dell Precision) and now am unable to re-install it so that it runs.

- I can start the mysqld daemon as root; when starting it gives a "FAILED" message, but from my processes I can see that it is indeed running, and there is a socket in the socket directory.

- Giving the "mysql" command in the terminal produces a "command not found" message, which is true: there is no "mysql" script in my /usr/bin directory.

- There is a "mysql_secure_installation" script in /usr/bin, but when I run it I get the following message.
  Can't find a 'mysql' client in PATH or ./bin

Looking at the successful installation on my laptop, I can't see either where a mysql client might be (other than /var/lib/mysql), where I have done anything special with my PATH in /etc/profile, or where the ./bin directory might be.

Any help is much appreciated.

thea

Last edited by thea (2011-10-21 20:51:53)

Offline

#2 2011-10-20 16:28:39

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: [SOLVED] MySQL re-installation fails

What commands did you use to reinstall? You should have an /etc/rc.d/mysqld script to start the daemon, and a bunch of various mysql helper scripts in /usr/bin...there is no '/usr/bin/mysql'. You should start it with the init script. Try to pacman -Rs mysql, then pacman -S mysql.

Scott

Offline

#3 2011-10-20 16:52:32

thea
Member
Registered: 2006-12-22
Posts: 86

Re: [SOLVED] MySQL re-installation fails

The command I used for re-installation was:
  pacman -S mysql

I got the following message (as usual) from the install:
**********************************************************************************************************************

(1/1) checking package integrity                          [##############################] 100%
(1/1) checking for file conflicts                         [##############################] 100%
(1/1) installing mysql                                    [##############################] 100%
usr/bin/mysql_install_db: line 321: hostname: command not found
WARNING: The host '' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h  password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/scripts/mysqlbug script!

Optional dependencies for mysql
    perl-dbi
    perl-dbd-mysql

***************************************************************************************************************************

When starting the daemon as suggested I get the following:

***************************************************************************************************************************
[thea@habicht ~]$ /usr/bin/mysqld_safe: line 531: hostname: command not found
111020 12:36:09 mysqld_safe Logging to '/var/lib/mysql/.err'.
/usr/bin/mysqld_safe: line 608: hostname: command not found
grep: grep": No such file or directory
111020 12:36:09 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

***************************************************************************************************************************

So the daemon starts. But when I try to use mysql:

***************************************************************************************************************************
[thea@habicht ~]$ mysql
bash: mysql: command not found
****************************************************************************************************************************

... whereas on my laptop this command works just fine and I can proceed with my database work.

thea

Offline

#4 2011-10-20 20:44:26

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: [SOLVED] MySQL re-installation fails

Make sure you have done a 'pacman -Syu', and also make sure you have inetutils installed (provides the hostname command). /usr/bin/mysql is provided by mysql-clients, which should have been installed as a dependency of mysql (sorry I missed this detail in my first post). If mysql-clients is also installed (which it should be) then you need to check you $PATH and make sure /usr/bin is in your $PATH.

Scott

Offline

#5 2011-10-21 20:50:36

thea
Member
Registered: 2006-12-22
Posts: 86

Re: [SOLVED] MySQL re-installation fails

Thanks Scott!

Did as you suggested: installed inetutils and upgraded mysql-clients, which gave me the mysql bin script. /usr/bin was already in my PATH. The mysqld daemon starts now as usual and I can proceed to use MySQL.

thanks again,

thea

Offline

Board footer

Powered by FluxBB