linux怎么查看本机内存大小
285
2022-10-10
二进制 mysql 5.7 安装
mysql 5.7 安装
#安装依赖包 [root06:07 PMcentos7 ~]#yum -y install libaio numactl-libs #创建系统账户 [root06:07 PMcentos7 ~]#useradd -r -g mysql -s /bin/false mysql #解压二进制安装包 [root06:09 PMcentos7 ~]#tar xf mysql-5.7.29-linux-glibc2.12-x86_64.tar.gz -C /usr/local root06:18 PMcentos7 ~]#cd /usr/local/ [root06:18 PMcentos7 /usr/local]#ls bin etc games include lib lib64 libexec mysql mysql-5.7.29-linux-glibc2.12-x86_64 sbin share src #创建软链接 [root06:10 PMcentos7 /usr/local]#ln -s mysql-5.7.29-linux-glibc2.12-x86_64/ mysql [root06:18 PMcentos7 /usr/local]#ll mysql lrwxrwxrwx 1 root root 36 May 12 18:11 mysql -> mysql-5.7.29-linux-glibc2.12-x86_64/ #修改软链接的权限 [root06:18 PMcentos7 /usr/local]#chown -R root.root /usr/local/mysql/ [root06:19 PMcentos7 /usr/local]#echo 'PATH=/usr/local/mysql/bin:$PATH' > /etc/profile.d/mysql.sh [root06:19 PMcentos7 /usr/local]#. /etc/profile.d/mysql.sh #修改服务端和客服端的配置文件 cp /etc/my.cnf{,.bak} [root06:19 PMcentos7 /usr/local]#vim /etc/my.cnf [mysqld] datadir=/data/mysql skip_name_resolve=1 socket=/data/mysql/mysql.sock log-error=/data/mysql/mysql.log pid-file=/data/mysql/mysql.pid [client] socket=/data/mysql/mysql.sock !includedir /etc/my.cnf.d #生成数据库 [root06:57 PMcentos7 /usr/local/mysql]#cd support-files/ [root06:57 PMcentos7 /usr/local/mysql/support-files]#ls magic mysqld_multi.server mysql-log-rotate mysql.server #指定目录生成数据库文件 [root06:25 PMcentos7 /usr/local]#mysqld --initialize --user=mysql --datadir=/data/mysql [root06:26 PMcentos7 /usr/local]#ll /data/mysql/ total 110664 -rw-r----- 1 mysql mysql 56 May 12 18:26 auto.cnf -rw------- 1 mysql mysql 1676 May 12 18:26 ca-key.pem -rw-r--r-- 1 mysql mysql 1112 May 12 18:26 ca.pem -rw-r--r-- 1 mysql mysql 1112 May 12 18:26 client-cert.pem -rw------- 1 mysql mysql 1680 May 12 18:26 client-key.pem -rw-r----- 1 mysql mysql 425 May 12 18:26 ib_buffer_pool -rw-r----- 1 mysql mysql 12582912 May 12 18:26 ibdata1 -rw-r----- 1 mysql mysql 50331648 May 12 18:26 ib_logfile0 -rw-r----- 1 mysql mysql 50331648 May 12 18:26 ib_logfile1 drwxr-x--- 2 mysql mysql 4096 May 12 18:26 mysql -rw-r----- 1 mysql mysql 880 May 12 18:26 mysql.log drwxr-x--- 2 mysql mysql 8192 May 12 18:26 performance_schema -rw------- 1 mysql mysql 1676 May 12 18:26 private_key.pem -rw-r--r-- 1 mysql mysql 452 May 12 18:26 public_key.pem -rw-r--r-- 1 mysql mysql 1112 May 12 18:26 server-cert.pem -rw------- 1 mysql mysql 1680 May 12 18:26 server-key.pem drwxr-x--- 2 mysql mysql 8192 May 12 18:26 sys #查看生成的临时密码,5.7的安装不同于5.6的安装 [root06:32 PMcentos7 /usr/local]#cat /data/mysql/mysql.log 看日志里面生成了一个临时的密码 #服务开启的文件拷贝到/etc/init.d/ 且命名为mysqld [root06:32 PMcentos7 /usr/local]#cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld #加入到列表 [root06:35 PMcentos7 /usr/local]#chkconfig --add mysqld [root06:35 PMcentos7 /usr/local]#chkconfig --list #开启服务 [root06:36 PMcentos7 /usr/local]#service mysqld start Starting MySQL. #临时密码登录; [root06:38 PMcentos7 /usr/local]#mysql -uroot -p'&0bjkD86sV(Z' #修改密码 [root06:51 PMcentos7 /usr/local]#mysqladmin -uroot -p'&0bjkD86sV(Z' password 123456
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~