opensuse 12.2 - MYSQL 5.5 install problem.

My purpose is to install mysql with multiple instance. Each databases should be kept in separate directories.
First I started with a single database ignoring mysql_multi config.
I have wrote a script to automatized the process installation.
Doing so, I got every things is done the same way and correcting bugs is easier.

The whole process for this first step is :
1°) De-install mysql-community-server, client, … etc ( which reinstall mariadb )
2°) Destroy the database file if any exists ( which do nothing when first install )
3°) Create all directories if necessary ( which do nothing if not the first install )
and set owner to mysql:mysql
4°) Create the group mysql, create the user mysql, create the user mysql_admin if necessary ( of course do nothing if not the first install )
5°) Create the file /etc/my.cnf by copying a template and then updating with my personal parameter using sed :
datadir is set to /bdd/bd_1/mysql
socket is set to /bdd/bd_1/run/mysqld.sock
6°) run mysql_install_db from /bdd/bd_1/mysql
7°) start mysql

But I am unable to start mysql.

See full log : 2013_07_15_db-mysql_install_v1.txt : SUSE Paste
See /etc/my.cnf v1 : SUSE Paste

See systemctl messages :

linux:~ # systemctl start mysql.server.service
linux:~ # systemctl status mysql.server.service
mysql.server.service - LSB: start and stop MySQL
          Loaded: loaded (/etc/init.d/mysql.server)
          Active: active (exited) since Tue, 16 Jul 2013 16:59:53 +0200; 2s ago
         Process: 6947 ExecStop=/etc/init.d/mysql.server stop (code=exited, status=0/SUCCESS)
         Process: 6977 ExecStart=/etc/init.d/mysql.server start (code=exited, status=0/SUCCESS)
          CGroup: name=systemd:/system/mysql.server.service

Jul 16 16:59:53 linux-srv mysql.server[6977]: /etc/init.d/mysql.server: line 276: cd: /usr/local/mysql: No such file or directory
Jul 16 16:59:53 linux-srv mysql.server[6977]: Starting MySQLCouldn't find MySQL server (/usr/local/mysql/bin/mysqld_safe)..failed
linux:~ #

See /var/log/messages

§TIME§ Jul 16 16:59:53,§PR§ 6,§FCLTY§ 3,§HOST§ linux-srv, §TAG§  mysql.server[6977]:, §MSG§   /etc/init.d/mysql.server: line 276: cd: /usr/local/mysql: No such file or directory

§TIME§ Jul 16 16:59:53,§PR§ 6,§FCLTY§ 3,§HOST§ linux-srv, §TAG§  mysql.server[6977]:, §MSG§   Starting MySQLCouldn't find MySQL server (/usr/local/mysql/bin/mysqld_safe)..failed


After adding these parameters in the file /etc/my.cnf in the section [mysqld] :

pid-file = /bdd/bd_1/run/mysqld.pid
basedir = /usr

I could not run my script to the end anymore and stop in step 6.
I got an error during database creation using the new /etc/my.cnf

See full log : 2013_07_15_db-mysql_install_v2.txt SUSE Paste
See /etc/my.cnf v2 : SUSE Paste

If you look at the faulting command, you get an error about errmsg.sys :

Creating data directory in : /bdd/bd_1/mysql
CMD : /usr/bin/mysql_install_db  --defaults-file=/etc/my.cnf  --user=mysql   --datadir=/bdd/bd_1/mysql
.
. . . . . . . .  MESSAGE DEBUG END . . . . . . . . . . . . . . .
.
.

FATAL ERROR: Could not find errmsg.sys

The following directories were searched:

    /usr/share/english
    /usr/share/mysql/english

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.

If you add the basedir parameter, you get the same error message:

linux-srv:~ # /usr/bin/mysql_install_db  --defaults-file=/etc/my.cnf  --user=mysql   --basedir=/usr   --datadir=/bdd/bd_1/mysql

FATAL ERROR: Could not find errmsg.sys

The following directories were searched:

    /usr/share/english
    /usr/share/mysql/english

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.

Any help is welcome.

FATAL ERROR: Could not find errmsg.sys

Did you check, that the file errmsg.sys exists in the expected place?
Maybe you need to install additional packages, like mariadb-errormessages.

If the file is there this may by caused by differences between the compiled default directories and the places where the files are actually installed.
Then you might need to add more directory configurations (e.g. “lc-messages-dir”) to your my.cnf.

regards,
Hendrik

The file exists in /usr/share/mysql-community-server.

If my.cnf contains :

[mysqld]
port            = 3306
socket        = /bdd/bd_1/run/mysqld.sock
datadir        = /bdd/bd_1/mysql

the command :

/usr/bin/mysql_install_db  --defaults-file=/etc/my.cnf  --user=mysql   --datadir=/bdd/bd_1/mysql

finish with Success

If my.cnf contains :

[mysqld]
port            = 3306
socket        = /bdd/bd_1/run/mysqld.sock
pid-file        = /bdd/bd_1/run/mysqld.pid
basedir        = /usr
atadir        = /bdd/bd_1/mysql

the command :

/usr/bin/mysql_install_db  --defaults-file=/etc/my.cnf  --user=mysql   --basedir=/usr  --datadir=/bdd/bd_1/mysql

Failed.
In that case if I renamed existing ** /usr/share/mysql** which contains sample my.cnf config files and create a link /usr/share/mysql pointing to /usr/share/mysql-community-server.


the command :

/usr/bin/mysql_install_db --defaults-file=/etc/my.cnf --user=mysql --basedir=/usr --datadir=/bdd/bd_1/mysql


finish with success.

Very surprising.

Somebody has an idea ?

Is someone can send me a my.cnf with only one mysql database located in a directory other than the usual mysql directories .

Help i_s welcome.

The location of the database is set using “datadir” (only).

Maybe you should try not too many things at once.

a) Put multiple database directories for multiple server instances wherever you like; using the standard MySql packages from your version of openSUSE.

b) Install another MySQL version/Mariadb using the standard database locations and make sure, you have a working complete and consistent set of packages installed.

c) a) + b) …

I suspect you have a mix of different MySQL/Mariadb packages.

As I am using yast for this test, as soon as I install/reinstall mysql, because of dependencies, yast ask for removing mariadb (during install mysql), and then next time ask for install mariadb (during uninstall of mysql)

I am not trying to install multiple version of MYSQL and/or MARIADB.
I just want install multiple database ( one database by project ) because if I have to stop a database for maintenance , I do not want to stop the others.