mysql unrecognized service [Fixed] [Solved]

liloulinx
Messages : 20
Inscription : 05 décembre 2016, 13:07

mysql unrecognized service [Fixed] [Solved]

Message par liloulinx » 21 décembre 2016, 01:31

Hello,
I have installed CentOS 6.8 under an HP Proliant Server, by using an automatic kickstart. I use an internal network. So, this machine is not connected to Internet. I can not use "yum install url_to_package"
In this install I have installed "mariaDB" instead of mysql. There are the lines used for this:

Code : Tout sélectionner

 groupadd mysql
 useradd -g mysql mysql
 cd /usr/local
 tar -zxvpf /media/cdrom/COTS/mariadb-10.1.19-linux-x86_64.tar.gz
 ln -s mariadb-10.1.19-linux-x86_64 mysql
 cd mysql
 ./scripts/mysql_install_db --user=mysql 2>/root/erreur_install_mariaDB.log
 chown -R root .
 chown -R mysql data
When I try to start mysql by using the command "service mysql start", it generate an error of "unrecognized service"
The command

Code : Tout sélectionner

ll /etc/init.d | grep mysql
gives nothing !!

When I try to start mysql by using this command: "

Code : Tout sélectionner

./bin/mysqld_safe --user=mysql &
"
It display this error:

Code : Tout sélectionner

Can't create/write to file '/var/run/mysqld/mysqld.pid No such file or directory...
So, I have created the "/var/run/mysqld" directory and changed its owner.

Code : Tout sélectionner

 mkdir /var/run/mysqld
 chown mysql:mysql /var/run/mysqld

Now I can start mysql by using the command "./bin/mysqld_safe --user=mysql &", but I still can not use the command "service mysql start" !!!
Thanks in advance for your propositions.
Liloulinx.
Dernière modification par liloulinx le 23 décembre 2016, 18:22, modifié 1 fois.

Beta-Pictoris
Messages : 896
Inscription : 07 janvier 2014, 21:48
Localisation : Angers, France

Re: mysql unrecognized service

Message par Beta-Pictoris » 21 décembre 2016, 03:31

You have downloaded a generic source for all linux systems. In the case, system V init script is not provided I think. You must create it !
But, there is a mariadb repository with packages for Centos 6 : https://mariadb.com/kb/en/mariadb/yum/
So, it is not necessary to compile it again. :)

liloulinx
Messages : 20
Inscription : 05 décembre 2016, 13:07

Re: mysql unrecognized service

Message par liloulinx » 21 décembre 2016, 12:36

Thank you for your answer.
I can not use yum because I'm under a closed network (no internet).
In the first time I have used rpm files to install mariaDB, but this need some libraries (like ex. libjemalloc.so) which are not available for CentOS 6.8.

liloulinx
Messages : 20
Inscription : 05 décembre 2016, 13:07

Re: mysql unrecognized service [Fixed] [Solved]

Message par liloulinx » 23 décembre 2016, 18:22

I have used "yum" and it works.
So, I have :
  1. Deleted/moved the repos files

    Code : Tout sélectionner

    mv /etc/yum.repos.d/CentOS-* $backup_dir/yum.repos.d/
    
  2. Downloaded the MariaDB packages (containning RPMs, repodata folder and setup_repository script). http://downloads.mariadb.org/
  3. Downloaded the MariaDB public_key (from https://downloads.mariadb.com/MariaDB/y ... EY-MariaDB)
  4. Created the MariaDB repos
    Modified the script "setup_repository" to check the mariadb key from the downloaded file
    I have modified the gpgkey line to become:

    Code : Tout sélectionner

    gpgkey=file:///media/cdrom/MariaDB_Packages/public_key/RPM-GPG-KEY-MariaDB
    
    # Running the setup_repository script which create the MariaDB repository "

    Code : Tout sélectionner

    bash setup_repository
  5. Running yum install

    Code : Tout sélectionner

    # Running the yum install command to install MariaDB"
    yum install -y MariaDB-server  MariaDB-client
    

Répondre