使用二进制安装包的方式单机部署MySQL8.0.13
使用二进制安装包的方式单机部署MySQL8.0.13
作者:尹正杰
版权声明:原创作品,谢绝转载!否则将追究法律责任。
关于MySQL的介绍我这里就不多做赘述了,如何下载MySQL详情请参考:MySQL入门介绍(mysql-8.0.13)。本篇博客默认你已经将MySQL二进制tar包下载好并上传到服务器上了。
一.使用默认的安装路径部署MySQL服务
1>.安装上传工具
[root@node101 ~]# yum -y install lrzsz
2>.上传MySQL的二进制安装包到服务器上
[root@node101 ~]# cd /usr/local/
[root@node101 local]#
[root@node101 local]# ls
bin etc games include lib lib64 libexec sbin share src
[root@node101 local]#
[root@node101 local]# rz
rz waiting to receive.
开始 zmodem 传输。 按 Ctrl+C 取消。
% KB KB/s :: Errorss.xz... [root@node101 local]#
[root@node101 local]# ls
bin etc games include lib lib64 libexec mysql-8.0.-linux-glibc2.-x86_64.tar.xz sbin share src
[root@node101 local]#
3>.在“/usr/local"目录进行解压操作并创建符号链接
[root@node101 local]# ll
total
drwxr-xr-x. root root Aug bin
drwxr-xr-x. root root Aug etc
drwxr-xr-x. root root Aug games
drwxr-xr-x. root root Aug include
drwxr-xr-x. root root Aug lib
drwxr-xr-x. root root Aug lib64
drwxr-xr-x. root root Aug libexec
-rw-r--r--. root root Jan : mysql-8.0.-linux-glibc2.-x86_64.tar.xz
drwxr-xr-x. root root Aug sbin
drwxr-xr-x. root root Jan : share
drwxr-xr-x. root root Aug src
[root@node101 local]#
[root@node101 local]#
[root@node101 local]# tar -xf mysql-8.0.-linux-glibc2.-x86_64.tar.xz
[root@node101 local]#
[root@node101 local]# ll
total
drwxr-xr-x. root root Aug bin
drwxr-xr-x. root root Aug etc
drwxr-xr-x. root root Aug games
drwxr-xr-x. root root Aug include
drwxr-xr-x. root root Aug lib
drwxr-xr-x. root root Aug lib64
drwxr-xr-x. root root Aug libexec
drwxr-xr-x. root root Jan : mysql-8.0.-linux-glibc2.-x86_64
-rw-r--r--. root root Jan : mysql-8.0.-linux-glibc2.-x86_64.tar.xz
drwxr-xr-x. root root Aug sbin
drwxr-xr-x. root root Jan : share
drwxr-xr-x. root root Aug src
[root@node101 local]#
[root@node101 local]# tar -xf mysql-8.0.13-linux-glibc2.12-x86_64.tar.xz
[root@node101 local]# ll
total
drwxr-xr-x. root root Aug bin
drwxr-xr-x. root root Aug etc
drwxr-xr-x. root root Aug games
drwxr-xr-x. root root Aug include
drwxr-xr-x. root root Aug lib
drwxr-xr-x. root root Aug lib64
drwxr-xr-x. root root Aug libexec
drwxr-xr-x. root root Jan : mysql-8.0.-linux-glibc2.-x86_64
-rw-r--r--. root root Jan : mysql-8.0.-linux-glibc2.-x86_64.tar.xz
drwxr-xr-x. root root Aug sbin
drwxr-xr-x. root root Jan : share
drwxr-xr-x. root root Aug src
[root@node101 local]#
[root@node101 local]#
[root@node101 local]# ln -s /usr/local/mysql-8.0.-linux-glibc2.-x86_64 /usr/local/mysql
[root@node101 local]#
[root@node101 local]# ll
total
drwxr-xr-x. root root Aug bin
drwxr-xr-x. root root Aug etc
drwxr-xr-x. root root Aug games
drwxr-xr-x. root root Aug include
drwxr-xr-x. root root Aug lib
drwxr-xr-x. root root Aug lib64
drwxr-xr-x. root root Aug libexec
lrwxrwxrwx. root root Jan : mysql -> /usr/local/mysql-8.0.-linux-glibc2.-x86_64
drwxr-xr-x. root root Jan : mysql-8.0.-linux-glibc2.-x86_64
-rw-r--r--. root root Jan : mysql-8.0.-linux-glibc2.-x86_64.tar.xz
drwxr-xr-x. root root Aug sbin
drwxr-xr-x. root root Jan : share
drwxr-xr-x. root root Aug src
[root@node101 local]#
创建软连接([root@node101 local]# ln -s /usr/local/mysql-8.0.13-linux-glibc2.12-x86_64 /usr/local/mysql)
[root@node101 local]# du -h --max-depth=
./bin
./etc
./games
./include
./lib
./lib64
./libexec
./sbin
.0K ./share
./src
.0G ./mysql-8.0.-linux-glibc2.-x86_64 #加压后的大小是2个G
.3G .
[root@node101 local]#
[root@node101 local]#
4>.MySQL各个目录功能
[root@node101 local]# ll mysql/
total
drwxr-xr-x. root root Jan : bin #存放MySQL可执行的脚本
drwxr-xr-x. root root Jan : docs #存放文档信息
drwxr-xr-x. root root Jan : include #由于MySQL是C和C++编写的,因次我们会在该目录下看到一些以"*.h”的头文件信息
drwxr-xr-x. root root Jan : lib #存放依赖包
-rw-r--r--. Oct : LICENSE
-rw-r--r--. Oct : LICENSE.router
drwxr-xr-x. root root Jan : man #存放man帮助的信息
-rw-r--r--. Oct : README
-rw-r--r--. Oct : README.router
drwxr-xr-x. root root Jan : share #存放支持的字符集信息以及一些错误信息
drwxr-xr-x. root root Jan : support-files #存放MySQL服务的管理脚本,比如我们想要将MySQL变成一个Linux开机自启动服务时,就得使用该目录下的mysql.service脚本!
[root@node101 local]#
[root@node101 local]#
5>.创建默认的数据目录
[root@node101 local]# mkdir /usr/local/mysql/data
[root@node101 local]#
[root@node101 local]# ll mysql/
total
drwxr-xr-x. root root Jan : bin
drwxr-xr-x. root root Jan : data
drwxr-xr-x. root root Jan : docs
drwxr-xr-x. root root Jan : include
drwxr-xr-x. root root Jan : lib
-rw-r--r--. Oct : LICENSE
-rw-r--r--. Oct : LICENSE.router
drwxr-xr-x. root root Jan : man
-rw-r--r--. Oct : README
-rw-r--r--. Oct : README.router
drwxr-xr-x. root root Jan : share
drwxr-xr-x. root root Jan : support-files
[root@node101 local]#
如下图所示,我们需要创建mysql默认的数据目录([root@node101 local]# mkdir /usr/local/mysql/data)
6>.创建mysql用户(不建议使用root用户直接启动该服务)
[root@node101 local]# useradd mysql #这条命令会默认帮我们创建一个mysql用户,并将该用户加入一个同名的组中
[root@node101 local]#
[root@node101 local]# id mysql
uid=(mysql) gid=(mysql) groups=(mysql)
[root@node101 local]#
[root@node101 local]#
[root@node101 local]# pwd
/usr/local
[root@node101 local]#
[root@node101 local]# ll
total
drwxr-xr-x. root root Aug bin
drwxr-xr-x. root root Aug etc
drwxr-xr-x. root root Aug games
drwxr-xr-x. root root Aug include
drwxr-xr-x. root root Aug lib
drwxr-xr-x. root root Aug lib64
drwxr-xr-x. root root Aug libexec
lrwxrwxrwx. root root Jan : mysql -> /usr/local/mysql-8.0.-linux-glibc2.-x86_64
drwxr-xr-x. root root Jan : mysql-8.0.-linux-glibc2.-x86_64
-rw-r--r--. root root Jan : mysql-8.0.-linux-glibc2.-x86_64.tar.xz
drwxr-xr-x. root root Aug sbin
drwxr-xr-x. root root Jan : share
drwxr-xr-x. root root Aug src
[root@node101 local]#
[root@node101 local]# chown mysql:mysql mysql
[root@node101 local]#
[root@node101 local]# ll
total
drwxr-xr-x. root root Aug bin
drwxr-xr-x. root root Aug etc
drwxr-xr-x. root root Aug games
drwxr-xr-x. root root Aug include
drwxr-xr-x. root root Aug lib
drwxr-xr-x. root root Aug lib64
drwxr-xr-x. root root Aug libexec
lrwxrwxrwx. root root Jan : mysql -> /usr/local/mysql-8.0.-linux-glibc2.-x86_64
drwxr-xr-x. mysql mysql Jan : mysql-8.0.-linux-glibc2.-x86_64
-rw-r--r--. root root Jan : mysql-8.0.-linux-glibc2.-x86_64.tar.xz
drwxr-xr-x. root root Aug sbin
drwxr-xr-x. root root Jan : share
drwxr-xr-x. root root Aug src
[root@node101 local]#
修改解压包的权限给咱们刚刚创建的mysql用户([root@node101 local]# chown mysql:mysql mysql)
7>.初始化MySQL数据目录
[root@node101 ~]# ll /usr/local/mysql/data/
total
[root@node101 ~]#
[root@node101 ~]# cd /usr/local/mysql/bin/
[root@node101 bin]#
[root@node101 bin]# ./mysqld --initialize --user=mysql --datadir /usr/local/mysql/data
--16T00::.880029Z [Warning] [MY-] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
--16T00::.880151Z [System] [MY-] [Server] /usr/local/mysql-8.0.-linux-glibc2.-x86_64/bin/mysqld (mysqld 8.0.) initializing of server in progress as process
--16T00::.772135Z [Note] [MY-] [Server] A temporary password is generated for root@localhost: XwRQr7)jF0%M
--16T00::.974116Z [System] [MY-] [Server] /usr/local/mysql-8.0.-linux-glibc2.-x86_64/bin/mysqld (mysqld 8.0.) initializing of server has completed
[root@node101 bin]#
[root@node101 bin]#
[root@node101 bin]# ll /usr/local/mysql/data/
total
-rw-r-----. mysql mysql Jan : auto.cnf
-rw-------. mysql mysql Jan : ca-key.pem
-rw-r--r--. mysql mysql Jan : ca.pem
-rw-r--r--. mysql mysql Jan : client-cert.pem
-rw-------. mysql mysql Jan : client-key.pem
-rw-r-----. mysql mysql Jan : ib_buffer_pool
-rw-r-----. mysql mysql Jan : ibdata1
-rw-r-----. mysql mysql Jan : ib_logfile0
-rw-r-----. mysql mysql Jan : ib_logfile1
drwxr-x---. mysql mysql Jan : #innodb_temp
drwxr-x---. mysql mysql Jan : mysql
-rw-r-----. mysql mysql Jan : mysql.ibd
drwxr-x---. mysql mysql Jan : performance_schema
-rw-------. mysql mysql Jan : private_key.pem
-rw-r--r--. mysql mysql Jan : public_key.pem
-rw-r--r--. mysql mysql Jan : server-cert.pem
-rw-------. mysql mysql Jan : server-key.pem
drwxr-x---. mysql mysql Jan : sys
-rw-r-----. mysql mysql Jan : undo_001
-rw-r-----. mysql mysql Jan : undo_002
[root@node101 bin]#
[root@node101 bin]#
[root@node101 bin]# ./mysqld --initialize --user=mysql --datadir /usr/local/mysql/data
[root@node101 ~]# cd /usr/local/mysql/data/
[root@node101 data]# ll
total
-rw-r-----. mysql mysql Jan : auto.cnf
-rw-------. mysql mysql Jan : ca-key.pem
-rw-r--r--. mysql mysql Jan : ca.pem
-rw-r--r--. mysql mysql Jan : client-cert.pem
-rw-------. mysql mysql Jan : client-key.pem
-rw-r-----. mysql mysql Jan : ib_buffer_pool
-rw-r-----. mysql mysql Jan : ibdata1
-rw-r-----. mysql mysql Jan : ib_logfile0
-rw-r-----. mysql mysql Jan : ib_logfile1
drwxr-x---. mysql mysql Jan : #innodb_temp
drwxr-x---. mysql mysql Jan : mysql
-rw-r-----. mysql mysql Jan : mysql.ibd
drwxr-x---. mysql mysql Jan : performance_schema
-rw-------. mysql mysql Jan : private_key.pem
-rw-r--r--. mysql mysql Jan : public_key.pem
-rw-r--r--. mysql mysql Jan : server-cert.pem
-rw-------. mysql mysql Jan : server-key.pem
drwxr-x---. mysql mysql Jan : sys
-rw-r-----. mysql mysql Jan : undo_001
-rw-r-----. mysql mysql Jan : undo_002
[root@node101 data]# rm -rf *
[root@node101 data]#
多次初始化失败时,会报错说是数据目录已经有数据了,我们去对应的数据目录将其删除掉即可!
如果同学们在初始化遇到如下图所示的报错信息,大家不要慌,安装“libaio”依赖包即可:
[root@node105 data]# ll
total 0
[root@node105 data]#
[root@node105 data]# pwd
/yinzhengjie/softwares/mysql-8.0.14-linux-glibc2.12-x86_64/data
[root@node105 data]#
[root@node105 data]#
[root@node105 data]# mysqld --initialize --user=mysql --basedir=/yinzhengjie/softwares/mysql-8.0.14-linux-glibc2.12-x86_64 --datadir=/yinzhengjie/softwares/mysql-8.0.14-linux-glibc2.12-x86_64/data &
[] 3852
[root@node105 data]# mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory []+ Exit 127 mysqld --initialize --user=mysql --basedir=/yinzhengjie/softwares/mysql-8.0.14-linux-glibc2.12-x86_64 --datadir=/yinzhengjie/softwares/mysql-8.0.14-linux-glibc2.12-x86_64/data
[root@node105 data]#
[root@node105 data]#
[root@node105 data]#
[root@node105 data]# yum -y install libaio
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.sjtu.edu.cn
* extras: mirror.lzu.edu.cn
* updates: ftp.sjtu.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package libaio.x86_64 0:0.3.109-13.el7 will be installed
--> Finished Dependency Resolution Dependencies Resolved ========================================================================================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================================================================================
Installing:
libaio x86_64 0.3.109-13.el7 base 24 k Transaction Summary
========================================================================================================================================================================================================
Install 1 Package Total download size: 24 k
Installed size: 38 k
Downloading packages:
libaio-0.3.109-13.el7.x86_64.rpm | 24 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libaio-0.3.109-13.el7.x86_64 1/1
Verifying : libaio-0.3.109-13.el7.x86_64 1/1 Installed:
libaio.x86_64 0:0.3.109-13.el7 Complete!
[root@node105 data]#
[root@node105 data]#
[root@node105 data]#
[root@node105 data]# mysqld --initialize --user=mysql --basedir=/yinzhengjie/softwares/mysql-8.0.14-linux-glibc2.12-x86_64 --datadir=/yinzhengjie/softwares/mysql-8.0.14-linux-glibc2.12-x86_64/data &
[] 3858
[root@node105 data]#
[root@node105 data]#
[root@node105 data]#
[root@node105 data]# 2019-01-22T14:44:52.845268Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2019-01-22T14:44:52.845381Z 0 [System] [MY-013169] [Server] /yinzhengjie/softwares/mysql-8.0.14-linux-glibc2.12-x86_64/bin/mysqld (mysqld 8.0.14) initializing of server in progress as process 3858
2019-01-22T14:45:07.024823Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: d_0_b?C%8?2Y
2019-01-22T14:45:11.392014Z 0 [System] [MY-013170] [Server] /yinzhengjie/softwares/mysql-8.0.14-linux-glibc2.12-x86_64/bin/mysqld (mysqld 8.0.14) initializing of server has completed []+ Done mysqld --initialize --user=mysql --basedir=/yinzhengjie/softwares/mysql-8.0.14-linux-glibc2.12-x86_64 --datadir=/yinzhengjie/softwares/mysql-8.0.14-linux-glibc2.12-x86_64/data
[root@node105 data]#
[root@node105 data]# ll
total 155708
-rw-r-----. 1 mysql mysql 56 Jan 22 06:45 auto.cnf
-rw-------. 1 mysql mysql 1676 Jan 22 06:45 ca-key.pem
-rw-r--r--. 1 mysql mysql 1112 Jan 22 06:45 ca.pem
-rw-r--r--. 1 mysql mysql 1112 Jan 22 06:45 client-cert.pem
-rw-------. 1 mysql mysql 1676 Jan 22 06:45 client-key.pem
-rw-r-----. 1 mysql mysql 5748 Jan 22 06:45 ib_buffer_pool
-rw-r-----. 1 mysql mysql 12582912 Jan 22 06:45 ibdata1
-rw-r-----. 1 mysql mysql 50331648 Jan 22 06:45 ib_logfile0
-rw-r-----. 1 mysql mysql 50331648 Jan 22 06:44 ib_logfile1
drwxr-x---. 2 mysql mysql 6 Jan 22 06:45 #innodb_temp
drwxr-x---. 2 mysql mysql 4096 Jan 22 06:45 mysql
-rw-r-----. 1 mysql mysql 25165824 Jan 22 06:45 mysql.ibd
drwxr-x---. 2 mysql mysql 4096 Jan 22 06:45 performance_schema
-rw-------. 1 mysql mysql 1680 Jan 22 06:45 private_key.pem
-rw-r--r--. 1 mysql mysql 452 Jan 22 06:45 public_key.pem
-rw-r--r--. 1 mysql mysql 1112 Jan 22 06:45 server-cert.pem
-rw-------. 1 mysql mysql 1676 Jan 22 06:45 server-key.pem
drwxr-x---. 2 mysql mysql 27 Jan 22 06:45 sys
-rw-r-----. 1 mysql mysql 10485760 Jan 22 06:45 undo_001
-rw-r-----. 1 mysql mysql 10485760 Jan 22 06:45 undo_002
[root@node105 data]#
上述报错的解决方案([root@node105 data]# yum -y install libaio)
8>.启动MySQL服务
[root@node101 ~]# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/ #将MySQL加入到服务自启动
[root@node101 ~]#
[root@node101 ~]# rm -rf /etc/my.cnf #删除它表示以mysql所有的默认参数去启动
[root@node101 ~]#
[root@node101 ~]# /etc/init.d/mysql.server start #启动mysql服务
Starting MySQL.Logging to '/usr/local/mysql/data/node101.yinzhengjie.org.cn.err'.
. SUCCESS!
[root@node101 ~]#
[root@node101 ~]# ps -ef | grep mysql #查看mysql的启动进程
root : pts/ :: /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/node101.yinzhengjie.org.cn.pid
mysql : pts/ :: /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=node101.yinzhengjie.org.cn.err --pid-file=/usr/local/mysql/data/node101.yinzhengjie.org.cn.pid
root : pts/ :: grep --color=auto mysql
[root@node101 ~]#
[root@node101 ~]# netstat -untalp | grep 3306 #查看mysql启动的端口,默认是3306
tcp6 ::: :::* LISTEN /mysqld
tcp6 ::: :::* LISTEN /mysqld #这个33060是MySQL的守护进程
[root@node101 ~]#
9>.连接MySQL数据库
[root@node101 ~]# ll /usr/local/mysql/
total
drwxr-xr-x. root root Jan : bin
drwxr-xr-x. mysql mysql Jan : data
drwxr-xr-x. root root Jan : docs
drwxr-xr-x. root root Jan : include
drwxr-xr-x. root root Jan : lib
-rw-r--r--. Oct : LICENSE
-rw-r--r--. Oct : LICENSE.router
drwxr-xr-x. root root Jan : man
-rw-r--r--. Oct : README
-rw-r--r--. Oct : README.router
drwxr-xr-x. root root Jan : share
drwxr-xr-x. root root Jan : support-files
[root@node101 ~]#
[root@node101 ~]#
[root@node101 ~]# cat ~/.bash_profile
# .bash_profile # Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi # User specific environment and startup programs PATH=$PATH:$HOME/bin:/usr/local/mysql/bin export PATH
[root@node101 ~]#
[root@node101 ~]#
[root@node101 ~]# source ~/.bash_profile
[root@node101 ~]#
[root@node101 ~]#
[root@node101 ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 8.0. Copyright (c) , , Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>
[root@node101 ~]# mysql -uroot -p
10>.重置MySQL的密码(mysql8.0版本和以往的MySQL5.7有所不同)
[root@node101 ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 8.0. Copyright (c) , , Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> alter user user() identified by 'yinzhengjie'; #重置MySQL的密码,将临时密码改为“yinzhengjie”
Query OK, rows affected (0.03 sec) mysql> exit
Bye
[root@node101 ~]#
[root@node101 ~]# mysql -uroot -pyinzhengjie #使用重置后的密码登录数据库
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 8.0. MySQL Community Server - GPL Copyright (c) , , Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
rows in set (0.01 sec) mysql> quit
Bye
[root@node101 ~]#
二.迁移MySQL的安装目录
1>.迁移服务前,需要先关闭MySQL服务
[root@node101 ~]# /etc/init.d/mysql.server status
SUCCESS! MySQL running ()
[root@node101 ~]#
[root@node101 ~]#
[root@node101 ~]# /etc/init.d/mysql.server stop
Shutting down MySQL... SUCCESS!
[root@node101 ~]#
[root@node101 ~]#
[root@node101 ~]# /etc/init.d/mysql.server status
ERROR! MySQL is not running
[root@node101 ~]#
2>.将MySQL的数据目录迁移到指定的路径
[root@node101 ~]# mkdir -pv /yinzhengjie/data
[root@node101 ~]#
[root@node101 ~]# ll /yinzhengjie/data/
total
[root@node101 ~]#
[root@node101 ~]#
[root@node101 ~]# ll /usr/local/
total
drwxr-xr-x. root root Aug bin
drwxr-xr-x. root root Aug etc
drwxr-xr-x. root root Aug games
drwxr-xr-x. root root Aug include
drwxr-xr-x. root root Aug lib
drwxr-xr-x. root root Aug lib64
drwxr-xr-x. root root Aug libexec
-rw-r--r--. root root Jan : mysql-8.0.-linux-glibc2.-x86_64
drwxr-xr-x. root root Aug sbin
drwxr-xr-x. root root Jan : share
drwxr-xr-x. root root Aug src
[root@node101 ~]#
[root@node101 ~]# mv /usr/local/mysql-8.0.-linux-glibc2.-x86_64 /yinzhengjie/data/mysql #停止服务后,我们将MySQL的数据目录移动到我们想要修改的指定位置
[root@node101 ~]#
[root@node101 ~]# ll /yinzhengjie/data/
total
drwxr-xr-x. mysql mysql Jan : mysql
[root@node101 ~]#
3>.编辑MySQL的配置文件(由于我们移动了MySQL的安装目录以及数据目录,因此默认的配置已经不生效了,需要手动指定!)
[root@node101 ~]#
[root@node101 ~]# cat /etc/my.cnf
[mysqld]
basedir=/yinzhengjie/data/mysql/ #指定MySQL的安装目录
datadir=/yinzhengjie/data/mysql/data #指定MySQL存放数据的目录
[root@node101 ~]#
4>.启动MySQL服务
[root@node101 ~]# /etc/init.d/mysql.server start
Starting MySQL. SUCCESS!
[root@node101 ~]#
三.安装MySQL是指定安装目录
1>.解压MySQL软件包到指定位置(指定你需要安装MySQL的路径,可以不是默认的"/usr/local"目录)
[root@node101 local]# mkdir -pv /yinzhengjie/softwares #创建存放MySQL的目录位置
mkdir: created directory ‘/yinzhengjie’
mkdir: created directory ‘/yinzhengjie/softwares’
[root@node101 local]#
[root@node101 local]# ll /yinzhengjie/softwares/
total
[root@node101 local]#
[root@node101 local]# tar -xf mysql-8.0.-linux-glibc2.-x86_64.tar.xz -C /yinzhengjie/softwares/ #创建MySQL的软件包
[root@node101 local]#
[root@node101 local]# ll /yinzhengjie/softwares/
total
drwxr-xr-x. root root Jan : mysql-8.0.-linux-glibc2.-x86_64
[root@node101 local]#
2>.将解压后的安装目录指定给mysql用户
[root@node101 ~]# chown mysql:mysql -R /yinzhengjie/softwares/mysql-8.0.-linux-glibc2.-x86_64/
[root@node101 ~]#
[root@node101 ~]# ll /yinzhengjie/softwares/
total
drwxr-xr-x. mysql mysql Jan : mysql-8.0.-linux-glibc2.-x86_64
[root@node101 ~]#
[root@node101 ~]#
3>.配置MySQL的环境变量
[root@node101 ~]# ll /yinzhengjie/softwares/
total
drwxr-xr-x. mysql mysql Jan : mysql-8.0.-linux-glibc2.-x86_64
[root@node101 ~]#
[root@node101 ~]# ln -s /yinzhengjie/softwares/mysql-8.0.-linux-glibc2.-x86_64/ /yinzhengjie/softwares/mysql
[root@node101 ~]#
[root@node101 ~]# ll /yinzhengjie/softwares/
total
lrwxrwxrwx. root root Jan : mysql -> /yinzhengjie/softwares/mysql-8.0.-linux-glibc2.-x86_64/
drwxr-xr-x. mysql mysql Jan : mysql-8.0.-linux-glibc2.-x86_64
[root@node101 ~]#
[root@node101 ~]# cat ~/.bash_profile
# .bash_profile # Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi # User specific environment and startup programs PATH=$PATH:$HOME/bin:/yinzhengjie/softwares/mysql/bin/ export PATH
[root@node101 ~]#
[root@node101 ~]#
[root@node101 ~]# source ~/.bash_profile
[root@node101 ~]#
4>.初始化MySQL数据库
[root@node101 ~]# mysqld --initialize --user=mysql --basedir=/yinzhengjie/softwares/mysql --datadir=/yinzhengjie/softwares/mysql/data &
[]
[root@node101 ~]# --16T14::.941001Z [System] [MY-] [Server] /yinzhengjie/softwares/mysql-8.0.-linux-glibc2.-x86_64/bin/mysqld (mysqld 8.0.) initializing of server in progress as process
--16T14::.851566Z [Note] [MY-] [Server] A temporary password is generated for root@localhost: bSaeurfCP5)? #注意,记住这里的临时密码!
--16T14::.575983Z [System] [MY-] [Server] /yinzhengjie/softwares/mysql-8.0.-linux-glibc2.-x86_64/bin/mysqld (mysqld 8.0.) initializing of server has completed []+ Done mysqld --initialize --user=mysql --basedir=/yinzhengjie/softwares/mysql --datadir=/yinzhengjie/softwares/mysql/data
[root@node101 ~]#
[root@node101 ~]#
[root@node101 ~]# ll /yinzhengjie/softwares/mysql/data/
total
-rw-r-----. mysql mysql Jan : auto.cnf
-rw-------. mysql mysql Jan : ca-key.pem
-rw-r--r--. mysql mysql Jan : ca.pem
-rw-r--r--. mysql mysql Jan : client-cert.pem
-rw-------. mysql mysql Jan : client-key.pem
-rw-r-----. mysql mysql Jan : ib_buffer_pool
-rw-r-----. mysql mysql Jan : ibdata1
-rw-r-----. mysql mysql Jan : ib_logfile0
-rw-r-----. mysql mysql Jan : ib_logfile1
drwxr-x---. mysql mysql Jan : #innodb_temp
drwxr-x---. mysql mysql Jan : mysql
-rw-r-----. mysql mysql Jan : mysql.ibd
drwxr-x---. mysql mysql Jan : performance_schema
-rw-------. mysql mysql Jan : private_key.pem
-rw-r--r--. mysql mysql Jan : public_key.pem
-rw-r--r--. mysql mysql Jan : server-cert.pem
-rw-------. mysql mysql Jan : server-key.pem
drwxr-x---. mysql mysql Jan : sys
-rw-r-----. mysql mysql Jan : undo_001
-rw-r-----. mysql mysql Jan : undo_002
[root@node101 ~]#
[root@node101 ~]#
5>.修改MySQL的配置文件
[root@node101 ~]# cat /etc/my.cnf
[mysqld]
basedir=/yinzhengjie/softwares/mysql/
datadir=/yinzhengjie/softwares/mysql/data/
[root@node101 ~]#
6>.拷贝MySQL的启动脚本到系统自启动路径下并启动MySQL服务
[root@node101 ~]#
[root@node101 ~]# cp /yinzhengjie/softwares/mysql/support-files/mysql.server /etc/init.d/
[root@node101 ~]#
[root@node101 ~]# /etc/init.d/mysql.server start
Starting MySQL.Logging to '/yinzhengjie/softwares/mysql/data/node101.yinzhengjie.org.cn.err'.
. SUCCESS!
[root@node101 ~]#
[root@node101 ~]#
[root@node101 ~]#
[root@node101 ~]# /etc/init.d/mysql.server status
SUCCESS! MySQL running ()
[root@node101 ~]#
[root@node101 ~]#
[root@node101 ~]# ps -ef | grep mysql
root : pts/ :: /bin/sh /yinzhengjie/softwares/mysql//bin/mysqld_safe --datadir=/yinzhengjie/softwares/mysql/data/ --pid-file=/yinzhengjie/softwares/mysql/data//node101.yinzhengjie.org.cn.pid
mysql : pts/ :: /yinzhengjie/softwares/mysql/bin/mysqld --basedir=/yinzhengjie/softwares/mysql/ --datadir=/yinzhengjie/softwares/mysql/data --plugin-dir=/yinzhengjie/softwares/mysql//lib/plugin --user=mysql --log-error=node101.yinzhengjie.org.cn.err --pid-file=/yinzhengjie/softwares/mysql/data//node101.yinzhengjie.org.cn.pid
root : pts/ :: grep --color=auto mysql
[root@node101 ~]#
[root@node101 ~]#
7>.登录MySQL数据库
[root@node101 ~]# mysql -uroot -pyinzhengjie #我这里想用“yinzhengjie”作为密码登录,很显然失败了,因为我还没有授权!
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR (): Access denied for user 'root'@'localhost' (using password: YES)
[root@node101 ~]#
[root@node101 ~]#
[root@node101 ~]# mysql -uroot -p
Enter password: #注意,这里的密码是第4步骤初始化时的密码
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 8.0. Copyright (c) , , Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases; #注意,虽然我们使用临时密码登录成功了,但是我们不能执行任何的SQL语句,我们需要先修改密码才能执行具体的SQL。
ERROR (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql>
mysql> alter user user() identified by 'yinzhengjie'; #我们这里将当前用户的密码修改为“yinzhegjie”
Query OK, rows affected (0.01 sec) mysql> quit
Bye
[root@node101 ~]#
[root@node101 ~]# mysql -uroot -pyinzhengjie #此时,我们在用“yinzhegjie”这个字符串登录是成功的!
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 8.0. MySQL Community Server - GPL Copyright (c) , , Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
rows in set (0.01 sec) mysql> quit
Bye
[root@node101 ~]#
四.MySQL多实例安装
1>.将安装好的MySQL目录拷贝一份
[root@node101 ~]#
[root@node101 ~]# mv /yinzhengjie/softwares/mysql-8.0.-linux-glibc2.-x86_64/ /yinzhengjie/softwares/mysql
[root@node101 ~]#
[root@node101 ~]# ll /yinzhengjie/softwares/
total
drwxr-xr-x. mysql mysql Jan : mysql
[root@node101 ~]#
[root@node101 ~]# cp -r /yinzhengjie/softwares/mysql /yinzhengjie/softwares/mysql2
[root@node101 ~]#
[root@node101 ~]# ll /yinzhengjie/softwares/
total
drwxr-xr-x. mysql mysql Jan : mysql
drwxr-xr-x. root root Jan : mysql2
[root@node101 ~]#
[root@node101 ~]# chown mysql:mysql -R /yinzhengjie/softwares/mysql2
[root@node101 ~]#
[root@node101 ~]# ll /yinzhengjie/softwares/
total
drwxr-xr-x. mysql mysql Jan : mysql
drwxr-xr-x. mysql mysql Jan : mysql2 #该目录是我们拷贝后MySQL目录
[root@node101 ~]#
[root@node101 ~]#
2>.检查已经启动的MySQL服务
[root@node101 ~]# /etc/init.d/mysql.server status
SUCCESS! MySQL running ()
[root@node101 ~]#
[root@node101 ~]#
[root@node101 ~]# mysql -uroot -pyinzhengjie
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 8.0. MySQL Community Server - GPL Copyright (c) , , Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show variables like '%sock%';
+-----------------------------------------+------------------+
| Variable_name | Value |
+-----------------------------------------+------------------+
| mysqlx_socket | /tmp/mysqlx.sock | ----->#这里指定的了mysqlx的socket文件
| performance_schema_max_socket_classes | |
| performance_schema_max_socket_instances | - |
| socket | /tmp/mysql.sock | ------>#这里指定了mysql的默认socket文件
+-----------------------------------------+------------------+
rows in set (0.10 sec) mysql> quit
Bye
[root@node101 ~]#
[root@node101 ~]# netstat -untalp | grep
tcp6 ::: :::* LISTEN /mysqld #当前MySQL的实例
tcp6 ::: :::* LISTEN /mysqld #当前MySQL的守护进程
[root@node101 ~]#
[root@node101 ~]#
3>.启动新拷贝的MySQL实例
[root@node101 ~]# cat /etc/my3307.cnf #我们需要定义我们的配置文件
[mysqld]
basedir=/yinzhengjie/softwares/mysql2/
datadir=/yinzhengjie/softwares/mysql2/data/
port=
socket=/tmp/mysql3307.sock
mysqlx_port=
mysqlx_socket=/tmp/mysqlx33070.sock
[root@node101 ~]#
[root@node101 ~]# mysqld --defaults-file=/etc/my3307.cnf --user=mysql & #启动咱们配置好的实例,此处我们需要指定相应的MySQL配置文件
[]
[root@node101 ~]# --16T14::.894011Z [System] [MY-] [Server] /yinzhengjie/softwares/mysql/bin/mysqld (mysqld 8.0.) starting as process
--16T14::.682348Z [System] [MY-] [Server] Starting crash recovery...
--16T14::.692916Z [System] [MY-] [Server] Crash recovery finished.
--16T14::.761907Z [Warning] [MY-] [Server] CA certificate ca.pem is self signed.
--16T14::.782447Z [System] [MY-] [Server] /yinzhengjie/softwares/mysql/bin/mysqld: ready for connections. Version: '8.0.13' socket: '/tmp/mysql3307.sock' port: MySQL Community Server - GPL.
--16T14::.808012Z [System] [MY-] [Server] X Plugin ready for connections. Socket: '/tmp/mysqlx33070.sock' bind-address: '::' port: [root@node101 ~]#
[root@node101 ~]#
[root@node101 ~]# ps -ef | grep mysql
root : pts/ :: /bin/sh /yinzhengjie/softwares/mysql//bin/mysqld_safe --datadir=/yinzhengjie/softwares/mysql/data/ --pid-file=/yinzhengjie/softwares/mysql/data//node101.yinzhengjie.org.cn.pid
mysql : pts/ :: /yinzhengjie/softwares/mysql/bin/mysqld --basedir=/yinzhengjie/softwares/mysql/ --datadir=/yinzhengjie/softwares/mysql/data --plugin-dir=/yinzhengjie/softwares/mysql//lib/plugin --user=mysql --log-error=node101.yinzhengjie.org.cn.err --pid-file=/yinzhengjie/softwares/mysql/data//node101.yinzhengjie.org.cn.pid
mysql : pts/ :: mysqld --defaults-file=/etc/my3307.cnf --user=mysql #这里是我们刚刚启动的MySQL服务,想必大家对这个配置文件名称应该都眼熟吧!
root : pts/ :: grep --color=auto mysql
[root@node101 ~]#
[root@node101 ~]# netstat -untalp | grep #这是我们新启动的MySQL实例端口
tcp6 ::: :::* LISTEN /mysqld
tcp6 ::: :::* LISTEN /mysqld
[root@node101 ~]#
[root@node101 ~]#
[root@node101 ~]# netstat -untalp | grep 3306 #这个是咱们之前就以及启动的端口
tcp6 ::: :::* LISTEN /mysqld
tcp6 ::: :::* LISTEN /mysqld
[root@node101 ~]#
[root@node101 ~]#
4>.连接我们启动的MySQL目录
[root@node101 ~]# mysql -uroot -pyinzhengjie -S /tmp/mysql3307.sock #使用“-S”选项指定本地socket文件,我们知道使用的就是"/tmp/mysql.sock"
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 8.0. MySQL Community Server - GPL Copyright (c) , , Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
rows in set (0.00 sec) mysql> CREATE DATABASE yinzhengjie CHARACTER SET utf8; #我们在3307端口的数据库实例创建一个MySQL数据库
Query OK, row affected, warning (0.02 sec) mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
| yinzhengjie |
+--------------------+
rows in set (0.00 sec) mysql> quit
Bye
[root@node101 ~]#
[root@node101 ~]# mysql -uroot -pyinzhengjie
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 8.0. MySQL Community Server - GPL Copyright (c) , , Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases; #我们可以发现在3307端口的MySQL中创建的“yinzhengjie”数据库并没有影响当前的(3306端口)数据库信息!
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
rows in set (0.00 sec) mysql> quit
Bye
[root@node101 ~]#
扩展小提示:
[root@node101 ~]# mysql -uroot -pyinzhengjie -S /tmp/mysql3307.sock
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 8.0. MySQL Community Server - GPL Copyright (c) , , Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show variables like '%sock%';
+-----------------------------------------+-----------------------+
| Variable_name | Value |
+-----------------------------------------+-----------------------+
| mysqlx_socket | /tmp/mysqlx33070.sock |
| performance_schema_max_socket_classes | |
| performance_schema_max_socket_instances | - |
| socket | /tmp/mysql3307.sock |
+-----------------------------------------+-----------------------+
rows in set (0.01 sec) mysql> quit
Bye
[root@node101 ~]#
[root@node101 ~]#
[root@node101 ~]# mysql -uroot -pyinzhengjie
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 8.0. MySQL Community Server - GPL Copyright (c) , , Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show variables like '%sock%';
+-----------------------------------------+------------------+
| Variable_name | Value |
+-----------------------------------------+------------------+
| mysqlx_socket | /tmp/mysqlx.sock |
| performance_schema_max_socket_classes | |
| performance_schema_max_socket_instances | - |
| socket | /tmp/mysql.sock |
+-----------------------------------------+------------------+
rows in set (0.01 sec) mysql> quit
Bye
[root@node101 ~]#
查看socket配置文件(mysql> show variables like '%sock%';)
[root@node101 ~]#
[root@node101 ~]# ll /yinzhengjie/softwares/mysql/data/
total
-rw-r-----. mysql mysql Jan : auto.cnf
-rw-r-----. mysql mysql Jan : binlog.
-rw-r-----. mysql mysql Jan : binlog.index
-rw-------. mysql mysql Jan : ca-key.pem
-rw-r--r--. mysql mysql Jan : ca.pem
-rw-r--r--. mysql mysql Jan : client-cert.pem
-rw-------. mysql mysql Jan : client-key.pem
-rw-r-----. mysql mysql Jan : ib_buffer_pool
-rw-r-----. mysql mysql Jan : ibdata1
-rw-r-----. mysql mysql Jan : ib_logfile0
-rw-r-----. mysql mysql Jan : ib_logfile1
-rw-r-----. mysql mysql Jan : ibtmp1
drwxr-x---. mysql mysql Jan : #innodb_temp
drwxr-x---. mysql mysql Jan : mysql
-rw-r-----. mysql mysql Jan : mysql.ibd
-rw-r-----. mysql mysql Jan : node101.yinzhengjie.org.cn.err
-rw-r-----. mysql mysql Jan : node101.yinzhengjie.org.cn.pid
drwxr-x---. mysql mysql Jan : performance_schema
-rw-------. mysql mysql Jan : private_key.pem
-rw-r--r--. mysql mysql Jan : public_key.pem
-rw-r--r--. mysql mysql Jan : server-cert.pem
-rw-------. mysql mysql Jan : server-key.pem
drwxr-x---. mysql mysql Jan : sys
-rw-r-----. mysql mysql Jan : undo_001
-rw-r-----. mysql mysql Jan : undo_002
[root@node101 ~]#
[root@node101 ~]#
[root@node101 ~]#
[root@node101 ~]#
[root@node101 ~]#
[root@node101 ~]#
[root@node101 ~]# ll /yinzhengjie/softwares/mysql2/data/
total
-rw-r-----. mysql mysql Jan : auto.cnf
-rw-r-----. mysql mysql Jan : binlog.
-rw-r-----. mysql mysql Jan : binlog.
-rw-r-----. mysql mysql Jan : binlog.index
-rw-------. mysql mysql Jan : ca-key.pem
-rw-r--r--. mysql mysql Jan : ca.pem
-rw-r--r--. mysql mysql Jan : client-cert.pem
-rw-------. mysql mysql Jan : client-key.pem
-rw-r-----. mysql mysql Jan : ib_buffer_pool
-rw-r-----. mysql mysql Jan : ibdata1
-rw-r-----. mysql mysql Jan : ib_logfile0
-rw-r-----. mysql mysql Jan : ib_logfile1
-rw-r-----. mysql mysql Jan : ibtmp1
drwxr-x---. mysql mysql Jan : #innodb_temp
drwxr-x---. mysql mysql Jan : mysql
-rw-r-----. mysql mysql Jan : mysql.ibd
-rw-r-----. mysql mysql Jan : node101.yinzhengjie.org.cn.err
-rw-r-----. mysql mysql Jan : node101.yinzhengjie.org.cn.pid
-rw-r-----. mysql mysql Jan : node101.yinzhengjie.org.pid
drwxr-x---. mysql mysql Jan : performance_schema
-rw-------. mysql mysql Jan : private_key.pem
-rw-r--r--. mysql mysql Jan : public_key.pem
-rw-r--r--. mysql mysql Jan : server-cert.pem
-rw-------. mysql mysql Jan : server-key.pem
drwxr-x---. mysql mysql Jan : sys
-rw-r-----. mysql mysql Jan : undo_001
-rw-r-----. mysql mysql Jan : undo_002
drwxr-x---. mysql mysql Jan : yinzhengjie
[root@node101 ~]#
对比2个实例底层的MySQL存储情况([root@node101 ~]# ll /yinzhengjie/softwares/mysql/data/)
推荐阅读1:在Mac OS环境下安装mysql服务。
推荐阅读2:Windows环境安装MySQL数据库。
推荐阅读3:使用yum源的方式单机部署MySQL8.0.13。
使用二进制安装包的方式单机部署MySQL8.0.13的更多相关文章
- 使用yum源的方式单机部署MySQL8.0.13
使用yum源的方式单机部署MySQL8.0.13 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 基本上开源的软件都支持三种安装方式,即rmp方式安装,源码安装和二进制方式安装.在 ...
- CentOS6.6安装mysql-5.7.25二进制安装包简易教程
#####1,安装前首先确认系统版本 [root@bogon:~]# cat /etc/redhat-release CentOS release 6.6 (Final) [root@bogon:~] ...
- centos7 二进制安装包安装 mysql5.6
centos7 二进制安装包安装 mysql5.6 一.下载mysql5.6二进制安装包 http://mirrors.sohu.com/mysql/MySQL-5.6/ 如:mysql-5.6.34 ...
- centos7 二进制版本安装 mysql8.0.13
一.下载mysql二进制安装包 mysql官网: https://dev.mysql.com/downloads/mysql/ 由于国内网络问题,个人建议使用国内开源镜像站下载: http://mir ...
- (七) Docker 部署 MySql8.0 一主一从 高可用集群
参考并感谢 官方文档 https://hub.docker.com/_/mysql y0ngb1n https://www.jianshu.com/p/0439206e1f28 vito0319 ht ...
- Docker部署Mysql8.0.20并配置主从复制
1. Linux安装Mysql8.0.20并配置主从复制(一主一从,双主双从) Linux安装Mysql8.0.20并配置主从复制(一主一从,双主双从) 2. 前提准备 # 创建主从数据库文件夹 ...
- (转)winform安装项目、安装包的制作、部署
本文转载自:http://zhan.renren.com/cxymst?gid=3602888498037535727&from=post&checked=true 1,解决方案—添加 ...
- 【原创】VB6.0应用程序安装包的生成(Setup Factory 9.0制作安装包的方法)
VB6.0应用程序安装包的生成,利用其自带的打包工具生成的安装程序很简陋,一点不美观:如果想让自己的应用程序安装的时候显得高大上一点,本教程提供使用Setup Factory 9.0制作安装包的方法. ...
- mysql-8.0.13在windows上的部署
1 .下载mysql-8.0.13-x64 官方网站:https://dev.mysql.com/downloads/mysql/ 2.解压到G盘 3.准备my.ini文件保存到解压目录 [mysql ...
随机推荐
- Gedit浏览器常用快捷键备注
此处只记录常用的,而通常意义上的应知应会不做汇总 搜索 : Ctrl +F : 查找字符串 Ctrl + G : 查找字符串的下一实例 Ctrl + Shift + G : 查找字符串的前一实例 Ct ...
- 抓包工具Fiddler的使用说明
软件介绍 Fiddler是一个C#实现的浏览器抓包和调试工具,fiddler启用后作为一个proxy存在于浏览器和服务器之间,从中监测浏览器与服务器之间的http/https级别的网络交互.目前可以支 ...
- springboot使用redis
1.pom文件中引入 spring-boot-starter-redis <dependency> <groupId>org.springframework.boot</ ...
- rt-thread中动态内存分配之小内存管理模块方法的一点理解
@2019-01-18 [小记] rt-thread中动态内存分配之小内存管理模块方法的一点理解 > 内存初始化后的布局示意 lfree指向内存空闲区首地址 /** * @ingroup Sys ...
- 20165223 《JAVA程序设计》第三周学习总结
教材学习内容总结 第四章是整个JAVA语言的基础和重点,要重点学习和把握. 第四章要点 基础 类 构造方法与对象的创建 类与程序的基本结构 重点 参数传值 对象组合 JAVA独有语法 实例成员与类成员 ...
- 解决python解析文件时输出乱码
首先获取到json模块,encoding指定文件编码utf-8,errors报错时忽略错误,print()输出结果看看是否有问题. # -*- coding: utf-8 -*- import jso ...
- webpack中babel配置 --- runtime-transform和babel-pollfill
webpack - babel配置 babel是一个javascript编译器,是前端开发中的一个利器.它突破了浏览器实现es标准的限制,使我们在开发中可以使用最新的javascript语法. 通过构 ...
- 跟我一起用node-express搭建一个小项目(mongodb)[二]
我的小项目主要是会用到MongoDB. 呵呵,我也是现学现卖. 都说小公司十八般武艺样样稀疏,没有办法啊! 兵来兵挡,将来将挡!自己是个兵呢?还是一个将呢! 没有公司培养,就自己培养自己呗.差的远一点 ...
- k短路(A*)
http://poj.org/problem?id=2449 #include <cstdio> #include <cstdlib> #include <cstring ...
- Educational Codeforces Round 53 (Rated for Div. 2)
http://codeforces.com/contest/1073 A. Diverse Substring #include <bits/stdc++.h> using namespa ...