第十周
1、在阿里云服务器搭建openv-p-n(有条件的同学再做)
搭建失败,用的腾讯云。配置都核对过(不然报错就不是这样的了)
2、通过编译、二进制安装MySQL5.7
编译:
918 tar -zxvf boost_1_78_0.tar.gz
919 cd boost_1_78_0
920 ./bootstrap.sh --with-libraries=all --with-toolset=gcc
921 ./b2 install --prefix=/usr
922 history
923 cd /usr/local/
924 ls
925 cd /usr/src/
926 ls
927 cd /usr/local/src/mysql-5.7.32/
928 cmake . -DCMAKE_INSTALL_PREFIX=/apps/mysql -DMYSQL_DATADIR=/data/mysql/ -DSYSCONFDIR=/etc/ -DMYSQL_USER=mysql -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DWITHOUT_MROONGA_STORAGE_ENGINE=1 -DWITH_DEBUG=0 -DWITH_READLINE=1 -DWITH_SSL=system -DWITH_ZLIB=system -DWITH_LIBWRAP=0 -DENABLED_LOCAL_INFILE=1 -DMYSQL_UNIX_ADDR=/data/mysql/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
929 rpm -qi boost
930 history
931 ls /usr/local/boost/
932 ls
933 cmake . -DCMAKE_INSTALL_PREFIX=/apps/mysql -DMYSQL_DATADIR=/data/mysql/ -DSYSCONFDIR=/etc/ -DMYSQL_USER=mysql -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DWITHOUT_MROONGA_STORAGE_ENGINE=1 -DWITH_DEBUG=0 -DWITH_READLINE=1 -DWITH_SSL=system -DWITH_ZLIB=system -DWITH_LIBWRAP=0 -DWITH_BOOST=/usr/local/boost -DENABLED_LOCAL_INFILE=1 -DMYSQL_UNIX_ADDR=/data/mysql/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
934 、
935 history
936 ls /usr/local/boost/
937 ls
938 tar -zxvf boost_1_59_0\(1\).tar.gz -C /usr/local/boost/
939 cd /usr/local/
940 ls
941 cd src/
942 ls
943 cd mysql-5.7.32/
944 ls
945 cmake . -DCMAKE_INSTALL_PREFIX=/apps/mysql -DMYSQL_DATADIR=/data/mysql/ -DSYSCONFDIR=/etc/ -DMYSQL_USER=mysql -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DWITHOUT_MROONGA_STORAGE_ENGINE=1 -DWITH_DEBUG=0 -DWITH_READLINE=1 -DWITH_SSL=system -DWITH_BOOST=/usr/local/boost -DWITH_ZLIB=system -DWITH_LIBWRAP=0 -DWITH_BOOST=/usr/local/boost -DENABLED_LOCAL_INFILE=1 -DMYSQL_UNIX_ADDR=/data/mysql/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
946 yum -y install ncurses-devel
947 cmake . -DCMAKE_INSTALL_PREFIX=/apps/mysql -DMYSQL_DATADIR=/data/mysql/ -DSYSCONFDIR=/etc/ -DMYSQL_USER=mysql -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DWITHOUT_MROONGA_STORAGE_ENGINE=1 -DWITH_DEBUG=0 -DWITH_READLINE=1 -DWITH_SSL=system -DWITH_BOOST=/usr/local/boost -DWITH_ZLIB=system -DWITH_LIBWRAP=0 -DWITH_BOOST=/usr/local/boost -DENABLED_LOCAL_INFILE=1 -DMYSQL_UNIX_ADDR=/data/mysql/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
948 rm -f CMakeCache.txt
949 cmake . -DCMAKE_INSTALL_PREFIX=/apps/mysql -DMYSQL_DATADIR=/data/mysql/ -DSYSCONFDIR=/etc/ -DMYSQL_USER=mysql -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DWITHOUT_MROONGA_STORAGE_ENGINE=1 -DWITH_DEBUG=0 -DWITH_READLINE=1 -DWITH_SSL=system -DWITH_BOOST=/usr/local/boost -DWITH_ZLIB=system -DWITH_LIBWRAP=0 -DWITH_BOOST=/usr/local/boost -DENABLED_LOCAL_INFILE=1 -DMYSQL_UNIX_ADDR=/data/mysql/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
950 make && make install
951 echo 'PATH=/apps/mysql/bin:$PATH' > /etc/profile.d/mysql.sh
952 . /etc/profile.d/mysql.sh
953 ./etc/profile.d/mysql.sh
954 . /etc/profile.d/mysql.sh
955 cd /apps/mysql/
956 scripts/mysql_install_db --datadir=/data/mysql/ --user=mysql
957 script/mysql_install_db --datadir=/data/mysql/ --user=mysql
958 scripts/mysql_install_db --datadir=/data/mysql/ --user=mysql
959 script/mysql_install_db --datadir=/data/mysql/ --user=mysql
960 ./script/mysql_install_db --datadir=/data/mysql/ --user=mysql
961 ./scripts/mysql_install_db --datadir=/data/mysql/ --user=mysql
962 ./scripts/mysql_install_db --datadir=/data/mysql --user=mysql
963 ./mysqld --user=mysql --datadir=/data/mysql/ --initialize
964 cd /apps/mysql/
965 ls
966 scripts/mysql_install_db --datadir=/data/mysql/ --user=mysql
967 ls
968 yum -y install perl perl-devel
969 ./scripts/mysql_install_db --datadir=/data/mysql/ --user=mysql
970 scripts/mysql_install_db --datadir=/data/mysql/ --user=mysql
971 ./mysqld --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data/ --initialize
972 cd /data/mysql/
973 ls
974 cd /usr/
975 ls
976 cd local/
977 ls
978 cd ..
979 cd /apps/
980 ls
981 cd mysql/
982 ls
983 echo 'PATH=/apps/mysql/bin:$PATH' > /etc/profile.d/mysql.sh
984 ./etc/profile.d/mysql.sh
985 . /etc/profile.d/mysql.sh
986 . /etc/profile.d/mysql.sh
987 ./mysqld --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data/ --initialize
988 ls
989 scripts/mysql_install_db --datadir=/data/mysql/ --user=mysql
990 cat README
991 bin/mysql_install_db
992 scripts/mysql_install_db --datadir=/data/mysql/ --user=mysql
993 ./scripts/mysql_install_db --datadir=/data/mysql/ --user=mysql
994 LS
995 ls
996 scripts/mysql_install_db --datadir=/data/mysql/ --user=mysql
997 yum -y install perl perl-devel
998 scripts/mysql_install_db --datadir=/data/mysql/ --user=mysql
999 reboot
1000 cd /apps/mysql/
1001 scripts/mysql_install_db --datadir=/data/mysql/ --user=mysql
1002 la
1003 ls
1004 cd bin/
1005 ls
1006 ll
1007 scripts /mysql_install_db --datadir=/data/mysql/ --user=mysql
1008 scripts bin/mysql_install_db --datadir=/data/mysql/ --user=mysql
1009 script bin/mysql_install_db --datadir=/data/mysql/ --user=mysql
1010 scripts/mysql_install_db --datadir=/data/mysql/ --user=mysql
1011 cd /apps/mysql/
1012 scripts/mysql_install_db --datadir=/data/mysql/ --user=mysql
1013 ls
1014 ./scripts/mysql_install_db --datadir=/data/mysql/ --user=mysql
1015 ./script/mysql_install_db --datadir=/data/mysql/ --user=mysql
1016 rpm -qi perl
1017 rpm -qi perl-devel
1018 ./scripts/mysql_install_db --datadir=/data/mysql/ --user=mysql
1019 ls -a
1020 ./bin/mysql_install_db
1021 mysql_install_db is deprecated. Please consider switching to mysqld --initialize
1022 history
1023 ./mysqld --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data/ --initialize
1024 mysqld --initialize
1025 mysql -uroot -pj:=i8Z+S2#eq
1026 mysql -uroot -pj:=i8Z+S2
1027 service start mysqld
1028 ps aux
1029 pstree
1030 systemctl enable --now myswld
1031 systemctl enable --now mysqld
1032 ls
1033 cd /usr/
1034 cd /data/mysql/
1035 ls
1036 ll
1037 cp -b /apps/mysql/support-files/my-default.cnf /etc/my.cnf
1038 cp /apps/mysql/support-files/mysql.server /etc/init.d/mysqld
1039 chkconfig --add mysqld
1040 service mysqld start
1041 chown -R 755 mysql:mysql /data/mysql/
1042 ll /data/mysql/
1043 chown -R mysql:mysql /data/mysql/
1044 service mysqld start
1045 mysql -uroot -pi8Z+S2#eq
1046 mysql -uroot -pj:=i8Z+S2#eq
1047 history
二进制:
userdel mysql
908 groupdel mysql
909 id mysql
910 groupadd -r -g 306 mysql
911 useradd -r -g 306 -u 306 -d /data/mysql mysql
912 mkdir /data/mysql
913 chown mysql:mysql /data/mysql
914 tar xf mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz -C /usr/local
915 cd /usr/local/
916 ls
917 ln -sv mysql-5.7.24-linux-glibc2.12-x86_64 mysql
918 chown -R root:root /usr/local/mysql/
919 cd /usr/local/mysql
920 ls
921 cp -b support-files/my-default.cnf /etc/my.cnf
922 vim /etc/mycnf
923 cp /etc/mycnf /etc/my.cnf
924 cd /usr/local/mysql/
999 echo 'PATH=/usr/local/mysql/bin:$PATH' > /etc/profile.d/mysql.sh
1000 . /etc/profile.d/mysql.sh
1001 vi /etc/my.cnf
1002 mysqld --initialize-insecure --user=mysql --datadir=/data/mysql
1003 mysqladmin -uroot password 123456
1004 cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
1005 chkconfig --add mysqld
1006 service mysqld start
1007 mysqladmin -uroot password 123456
1008 mysql -uroot -p
1009 mysqladmin -uroot password '123456'
1010 ps aux
1011 pstree
1012 mysqladmin -umysql password '123456'
1013 mysqld --initialize-insecure --user=root --datadir=/data/mysql
1014 systemctl stop mysqld
1015 mysqld --initialize-insecure --user=root --datadir=/data/mysql
1016 service mysqld stop
1017 mysqld --initialize-insecure --user=root --datadir=/data/mysql
1018 mysqladmin -umysql password '123456'
1019 history
1020 service mysqld start
1021 mysqladmin -umysql password '123456'
1022 service mysqld stop
1023 mysqld_safe --skip-grant-tables &
1024 2
1025 mysqld_safe --skip-grant-tables &
1026 mysql -uroot -p
1027 mysql -uroot -p123456
3、二进制安装mariadb10.4