首页 > 编程知识 正文

虚拟机安装centos7教程(在虚拟机安装centos7步骤)

时间:2023-05-05 01:37:55 阅读:74237 作者:574

a )下载mysql源安装包:

[ root @ localhost~] # wget http://dev.MySQL.com/get/MySQL 57-community-release-el7-8.noarch.rpm

可能会发生以下错误。 -找不到-bash: wget:命令

[ root @ localhost~] # yum-yinstallwget

[ root @ localhost~] # yum-yinstallsetup

[ root @ localhost~] # yum-yinstallperl

要解决wget无法执行的错误,必须运行上面三行命令

b )安装mysql源:

[ root @ localhost~] # yumlocalinstallmysql 57-community-release-el7-8.noarch.rpm

c )检测安装是否完成的:

[ root @ localhost~] # yumrepolistenabled|grep ' MySQL.*-community.* '

d )安装mysql:

[ root @ localhost~] # yuminstallmysql-community-server

e )配置mysql服务:的启动

[ root @ localhost~] # systemctlenablemysqld

h )更改系统的默认密码:

下面的命令即使我死活也不会出现密码,感兴趣的人请试试:

[ root @ localhost~] # grep ' atemporarypassword '/var/log/mysqld.log

您已将默认密码更改为:

[ root @ localhost usr ] # MySQL-uroot-p

Enter password:你在这里回车里就行了

mysql USE mysql;

readingtableinformationforcompletionoftableandcolumnnames

youcanturnoffthisfeaturetogetaquickerstartupwith-a

数据库更改

重要的是,以下命令行将根密码更改为自己的密码: 请记住。 杀了也不要告诉别人哦:

mysqlupdatemysql.usersetauthentication _ string=password (' * * * ' ) where user='root ';

MySQL flush权限; #马上生效。 不要使用quit,请直接执行以下命令进行授权,用于远程访问

mysqlgrantallprivilegeson *.* to ' root ' @ ' % % ' identified by ' Marlon ' withgrantoption;

MySQL flush权限;

然后可以在本地连接。 恭喜你。 在Linux上完成了mysql的安装。

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。