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.