LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-10-2015, 06:56 AM   #1
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
Mariadb secure_installation, "cant find mysql" but it exists & works?


This is a fresh, binary installation of mariadb-10.0.17 on Centos 6.6
I have mariadb installed under /tux/apps/mariadb-10.0/, it starts and runs fine.
The crazy problem is when I try to run mysql_secure_installation:
Code:
 
cd /tux/apps/mariadb-10.0
[root@tx-c1 mariadb-10.0]# bin/mysql_secure_installation --basedir=/tux/apps/mariadb-10.0
print: /tux/apps/mariadb-10.0/bin/my_print_defaults   <--- Exists
FATAL ERROR: Could not find mysql

The following directories were searched:
    /tux/apps/mariadb-10.0/bin   <--- This is the correct path!

[root@tx-c1 mariadb-10.0]# bin/mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.0.17-MariaDB-log MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.00 sec)
So the path is right, the server starts & runs fine - I can start it both using "service mariadb.server start" and by cd to basedir and execute "bin/mysqld_safe --basedir=/tux/apps/mariadb-10.0"
I shouldn't really need the "--basedir" as /etc/my.cnf points to my config file where base & data-dir are set? But I do - "service mariadb.server start" however obviously reads from /etc/my.cnf!

A few things checked:
Code:
 $ bin/my_print_defaults
(...)
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf 

$ ls -l /etc/my.cnf
lrwxrwxrwx. 1 root root 24 10 mar 12.06 /etc/my.cnf -> /tux/conf/mariadb/my.cnf

$ cat /tux/conf/mariadb/my.cnf
[mysqld]
user=someone
basedir = /tux/apps/mariadb-10.0
datadir = /tux/data/mariadb-10.0/var

skip-name-resolve
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 

log-bin=mariadb-bin
expire_logs_days = 10
max_binlog_size = 100M
So what is wrong? Everything except mysql_secure_installation works?
(I know how to manually secure it, but I don't like errors like these. Something is not right and I want to know what!)
 
Old 03-10-2015, 08:25 AM   #2
manoj_hanse
Member
 
Registered: Mar 2008
Posts: 48

Rep: Reputation: 1
Hi pingu,

Please post the output of only: ]#mysql_secure_installation


note: please don't modify the output in any way. Also don't add any paths to it.

Thanks.
 
Old 03-10-2015, 08:32 AM   #3
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Original Poster
Rep: Reputation: 127Reputation: 127
For some reason I need to add the --basedir even though /etc/my.cnf has correct settings, otherwise wrong path is searched.
Here's the output, with & without --basedir:
Code:
 [pingu@tx-c1 bin]$ sudo ./mysql_secure_installation

FATAL ERROR: Could not find /usr/local/mysql/bin/my_print_defaults

If you compiled from source, you need to run 'make install' to
copy the software into the correct location ready for operation.

If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.
Code:
 [pingu@tx-c1 bin]$ ./mysql_secure_installation --basedir=/tux/apps/mariadb-10.0
print: /tux/apps/mariadb-10.0/bin/my_print_defaults

FATAL ERROR: Could not find mysql

The following directories were searched:

    /tux/apps/mariadb-10.0/bin

If you compiled from source, you need to run 'make install' to
copy the software into the correct location ready for operation.

If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.
 
Old 03-10-2015, 10:37 PM   #4
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,622

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
--basedir=/tux/apps/mariadb-10.0

that would be wrong

that states that you made a folder called "tux" on the ROOT tree "/"
/boot
/bin
/etc
/usr
/var
/tux ??????????????

the owner of the folder MUST be root and only ROOT can edit that folder

instead of a more standard location
/usr/bin
/usr/share/apps/mariadb

if you did make a "tux" folder on the root tree
is it is the system $PATH ?
it is a very NON standard location

when you type
Code:
echo $PATH
is the folder"/tux/apps/mariadb-10.0" in that search path ?

Last edited by John VV; 03-10-2015 at 10:38 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] "net rpc" "failed to connect to ipc$ share on" or "unable to find a suitable server" larieu Linux - General 0 11-09-2014 12:45 AM
Linux INSERT live cd don't works: "can't find file system", sorry. maxmh Linux - Newbie 8 11-08-2014 09:24 PM
Find me source code for "iwlist" & "iwconfig" Angela Wu Linux - Kernel 2 09-15-2013 08:44 PM
How to eliminate "Error 1086 Files already exists " in mysql sanjay87 Linux - Server 2 03-28-2012 02:56 AM
Where can I find the "make" & "cc" packages?? sayeed_ather Mandriva 2 04-28-2004 02:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:34 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