生物商城网站建设,自己可以模拟装修app,朋友圈广告推广代理,网页布局的基础记录CentOS7.X版本下安装MySQL5.7数据库设置rpm下载目录在/opt目录下新建一个目录存放mysqlcd /optsudo mkdir mysql12下载MySQL的源如果在这之前没有提示-bash: wget: command not found#xff0c;那么还得先安装wgetsudo yum install wget1安装MySQL的rpmsudo rpm -ivh mys…记录CentOS7.X版本下安装MySQL5.7数据库设置rpm下载目录在/opt目录下新建一个目录存放mysqlcd /optsudo mkdir mysql12下载MySQL的源如果在这之前没有提示-bash: wget: command not found那么还得先安装wgetsudo yum install wget1安装MySQL的rpmsudo rpm -ivh mysql57-community-release-el7-8.noarch.rpm1安装MySQLsudo yum install mysql-server1在这步中只需要一直y然后回车就行数据库就安装好了现在进行连接mysql -uroot -prootERROR 2002 (HY000): Cant connect to local MySQL server through socket /var/lib/mysql/mysql.sock (2)123这是/var/lib/mysql权限问题修改MySQL权限为当前用户sudo chown -R xxx:xxx /var/lib/mysql1xxx为当前的用户名以及所属组重启MySQL服务service mysqld restart1密码输入root即可如果还不行的话通过这个命令获得初始密码cat /var/log/mysqld.log | grep password1其中A temporary password is generated for rootlocalhost: bGlY?13TtFyX–后面的就是初始密码登陆进去之后先不做其他操作作如下操作set global validate_password_policy0;set global validate_password_length4;12设置密码alter user rootlocalhost identified by root;1自此CentOS安装MySQL5.7就完美安装了mysql -uroot -pEnter password:Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 4Server version: 5.7.20 MySQL Community Server (GPL)Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type help; or \h for help. Type \c to clear the current input statement.mysql