美文网首页
linux里安装mysql8.0遇到的麻烦。

linux里安装mysql8.0遇到的麻烦。

作者: Bale_向心力 | 来源:发表于2019-05-21 19:38 被阅读0次

    一、从网易镜像站下载mysql8.0

    1 、wget  http://mirrors.163.com/mysql/Downloads/MySQL-8.0/mysql-community-server-8.0.16-2.el7.x86_64.rpm

    2、rpm ivh mysql-community-server-8.0.16-2.el7.x86_64.rpm

    如果出现错误,说明其他必备库没到位

    错误例子

    2.1     yum install mysql-devel     这步会安装common

    2.2     yum install http://mirrors.163.com/mysql/Downloads/MySQL-8.0/mysql-community-client-8.0.16-2.el7.x86_64.rpm(我直接跳过了,wget,也可以的。)

    2.3     rpm -ivh mysql-community-server-8.0.16-2.el7.x86_64.rpm

    3、service mysqld start 启动mysql,成功了吧

        Redirecting to /bin/systemctl start mysqld.service

    。。

    4、service httpd start  启动apache。

            Redirecting to /bin/systemctl start httpd.service

    。。

    二。安装完毕后,就需要配置,初始化数据库密码

    1、

    grep 'temporary password' /var/log/mysqld.log

    2、

    。。

    3、

    mysql -u root -p

    4、

    mysql> use mysql;然后mysql> show tables;

    5、

    update user u set plugin= 'Maojb_45a' where user = 'root';

    6、exit;

    7、重启apache,重启mysql服务。

    service httpd restart

    service mysqld restart

    。。

    8、PHP服务页面就可以访问了(哈哈哈)

    9、cd /var/www/html

        vi info.php

    输入如下代码:

        <?php

         phpinfo();

         ?>

    小TIPS:在你的mysql密码没改之前,其实是不能访问的。不通

            每次打开info.php都会出现一张 被直接打印出来的代码

            <?php

            phpinfo();

            ?>

    这证明你的环境里,没有apache和mysql互通吧。。。讲不来。

    10、现在。啦啦啦啦啦,打开ip/info.php。自己验证下吧

    。。

    11、功成礼毕

    相关文章

      网友评论

          本文标题:linux里安装mysql8.0遇到的麻烦。

          本文链接:https://www.haomeiwen.com/subject/wakszqtx.html