LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Mariadb secure_installation, "cant find mysql" but it exists & works? (https://www.linuxquestions.org/questions/linux-server-73/mariadb-secure_installation-cant-find-mysql-but-it-exists-and-works-4175536277/)

pingu 03-10-2015 06:56 AM

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!)

manoj_hanse 03-10-2015 08:25 AM

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.

pingu 03-10-2015 08:32 AM

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.


John VV 03-10-2015 10:37 PM

--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 ?


All times are GMT -5. The time now is 05:39 AM.