[Accueil]
Accueil
[Blog]
Blog
[GNU/Linux]
GNU/Linux
[Pierre L.]
Pierre L.
[Whist]
Whist
[Nous]
Nous
[Jabberwocky]
Jabberwocky
[LaTeX]
LaTeX


Previous Up Next


3.2 Installation

You are strongly encourraged to read installation instruction on the MySql 8.2.0 home page.

Here is my own installation procedure :

#!/bin/bash
### mysql.sh --- 
#  
# Copyright (C) 2023 Pierre L. Nageoire 
#  
# Author: Pierre L. Nageoire <devel@pollock-nageoire.net> 
# X-RCS: $Id: mysql.tex 307 2023-12-18 05:05:09Z devel $ 
#  
###############################################################  
#  
# This program is free software; you can redistribute it 
# and/or modify it under the terms of the GNU General Public 
# License as published by the Free Software Foundation; either 
# version 2, or (at your option) any later version. 
#  
# This program is distributed in the hope that it will be 
# useful, but WITHOUT ANY WARRANTY; without even the implied 
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
# PURPOSE. 
#  
# See the GNU General Public License for more details. 
#  
# You should have received a copy of the GNU General Public 
# License along with this program; see the file COPYING. 
#  
# If not, write to the Free Software Foundation, Inc., 51 
# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 
#  
###############################################################  
#  
### Commentary: 
#  
### Code: 
#  

    {
 userdel mysql || true
    } && {
 groupdel mysql || true
    } &&
 groupadd -g 40 mysql &&
 useradd -u 40 -r -g mysql -s /bin/false mysql &&
 export MYSQL_DATADIR=/srv/mysql &&
 export MYSQL_LOGDIR=/var/log/mysql &&
 export MYSQL_RUNDIR=/var/run/mysql &&
 export MYSQL_LOGFILE=${MYSQL_LOGDIR}/error.log &&
 rm -rfv bld &&
 mkdir -pv bld &&
 pushd bld &&
 cmake -DCMAKE_INSTALL_PREFIX=/usr \
       -DWITH_SSL=system -DWITH_BOOST=system \
       -DWITH_ICU=system \
       -DWITH_ZLIB=system \
       -DWITH_ZSTD=system \
       -DINSTALL_INCLUDEDIR=include/mysql \
       -DINSTALL_LIBDIR=lib/mysql \
       -DINSTALL_MANDIR=share/man \
       -DINSTALL_MYSQLSHAREDIR=share/mysql \
       -DINSTALL_SHAREDIR=share/mysql \
       -DINSTALL_MYSQLTESTDIR=lib/mysql-test \
       -DINSTALL_PLUGINDIR=lib/mysql/plugin \
       -DROUTER_INSTALL_PLUGINDIR=lib/mysqlrouter/plugin \
       -DINSTALL_SBINDIR=sbin \
       -DSYSCONFDIR=/etc/mysql \
       -DMYSQL_UNIX_ADDR=${MYSQL_RUNDIR}/mysqld.sock \
       -DMYSQL_DATADIR=${MYSQL_DATADIR} \
       -DINSTALL_DOCDIR=share/doc/mysql \
       -DINSTALL_DOCREADMEDIR=share/doc/mysql \
       -DINSTALL_INFODIR=share/info \
       -DINSTALL_SUPPORTFILESDIR=share/mysql \
       .. &&
 make -j4 &&
 make install &&
 mkdir -pv ${MYSQL_DATADIR} &&
 rm -rfv ${MYSQL_DATADIR}/* &&
 chown -v mysql:mysql ${MYSQL_DATADIR} &&
 chmod -v 750 ${MYSQL_DATADIR} &&
 rm -rf ${MYSQL_LOGDIR} &&
 mkdir -pv ${MYSQL_LOGDIR} &&
 chown -v mysql:mysql ${MYSQL_LOGDIR} &&
 chmod -v 750 ${MYSQL_LOGDIR} &&
 mkdir -pv ${MYSQL_RUNDIR} &&
 chown -v mysql:mysql ${MYSQL_RUNDIR} &&
 chmod -v 750 ${MYSQL_RUNDIR} &&
 mysqld --initialize --user=mysql --log-error=${MYSQL_LOGFILE} &&
 chown -v mysql:mysql ${MYSQL_LOGFILE} &&
 mysql_ssl_rsa_setup && {
     mysqld_safe --user=mysql --log-error=${MYSQL_LOGFILE} &
 } &&
 popd

Previous Up Next



gli amanti la muerte la torre il mondo


Copyright (©) 2009 -- 2025 Pierre L. Nageoire


Apache/2.4.52 (Unix) PHP/8.1.3 SVN/1.14.1 Hevea 2.36