curl -L -O https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.23-el7-x86_64.tar
[root]# rpm -qa|grep mysql[root]# rpm -qa |grep mariadb-libs
yum fjern mariadb-libs -y
tar -xvf mysql-8.0.23-el7-x86_64.tar
[root]# groupadd mysql[root]# useradd -r -g mysql -s /bin/false mysql [root]# cd /usr/local/
[root local]# tar xzvf /root/mysql-8.0.23-el7-x86_64.tar.gz
sudo ln -s /usr/local/mysql-8.0.23-el7-x86_64/ mysql
mkdir -p /mysql/{3306,3307,3308,3309}/data
chown -R mysql:mysql /mysql
cd /mysql
Eksempel 1 (3306)
[mysqld]port =3306basedir=/usr/local/mysql/
datadir=/mysql/3306/data
lower_case_table_names=1
innodb_buffer_pool_size=128M
socket =/tmp/mysql_3306.sock
log_error=/mysql/3306/data/mysql06.log
Eksempel 2 (3307)
[mysqld]port =3307basedir=/usr/local/mysql/
datadir=/mysql/3307/data
lower_case_table_names=1
innodb_buffer_pool_size=128M
socket =/tmp/mysql_3307.sock
log_error=/mysql/3307/data/mysql07.log
Eksempel 3 (3308)
[mysqld]port =3308basedir=/usr/local/mysql/
datadir=/mysql/3308/data
lower_case_table_names=1
innodb_buffer_pool_size=128M
socket =/tmp/mysql_3308.sock
log_error=/mysql/3308/data/mysql08.log
3306
/usr/local/mysql/bin/mysqld –defaults-file=/mysql/3306/my.cnf –initialize –basedir=/usr/local/mysql/ –datadir=/mysql/3306/data
3307
/usr/local/mysql/bin/mysqld –defaults-file=/mysql/3307/my.cnf –initialize –basedir=/usr/local/mysql/ –datadir=/mysql/3307/data
3308
/usr/local/mysql/bin/mysqld –defaults-file=/mysql/3308/my.cnf –initialize –basedir=/usr/local/mysql/ –datadir=/mysql/3308/data
ln -s /usr/local/mysql/bin/mysqld /usr/bin
[root]# vi /etc/profileeller vi .bash_profile
# Tilføj følgende oplysninger i slutningen af filen
eksport PATH=$PATH:/usr/local/mysql/bin
#Få miljøvariabler til at træde i kraft
[root]# kilde /etc/profile
# Efter test er nogle af de filtilladelser, der for nylig blev genereret af mysql under initialisering, root, så det er bedst at genautorisere datadir-stien til mysql, før du starter
chown -R mysql:mysql /mysql
nohup /usr/local/mysql/bin/mysqld –defaults-file=/mysql/3306/my.cnf –user=mysql &
nohup /usr/local/mysql/bin/mysqld –defaults-file=/ mysql/3307/my.cnf –user=mysql &
nohup /usr/local/mysql/bin/mysqld –defaults-file=/mysql/3308/my.cnf –user=mysql &
ps -ef| grep mysql
netstat -ntl
#Skift adgangskode for alle forekomster én efter én:
mysql -S /tmp/mysql_3306.sock -p
#indtast midlertidig adgangskode fra log:
ændre bruger 'root'@'localhost' identificeret af 'Not_so_secure1!';
for at lukke en instans
[[email protected] bin]# pwd
/usr/local/mysql/bin
[[email protected] bin]# ./mysqladmin -h127.0.0 .1 -uroot -p -P3306 nedlukning
Indtast adgangskode:
[email protected] bin]# ps -ef| grep mysql
mysql 22218 21246 0 11:56 pts/1 00:00:03 /usr/local/mysql/bin/mysqld –defaults-file=/mysql/3307/my.cnf –user
mysql 22259 21246 0 11:56 pts/1 00:00:03 /usr/local/mysql/bin/mysqld –defaults-file=/mysql/3308/my.cnf –user=mysql 2br /67root 21537 0 12:24 pts/2 00:00:00 mysql -S /tmp/mysql_3306.sock -p
root 22705 21537 0 12:26 pts/2 00:00:00 mysgrepl=farve /P>