精华内容
下载资源
问答
  • 把下载的mysql安装包上传到Centos上解压mysql,我这是在Windows上解压的上传到Centos上,我在Centos上解压mysql不知道为什么少了rpm -ivh mysql-community-common-5.7.25-1.el6.x86_64.rpm包tar –...

    1.mysql-5.7.25-1.el6.x86_64.rpm-bundle.tar下载百度云资源

    提取码:ej1y

    2.把下载的mysql安装包上传到Centos上

    解压mysql,我这是在Windows上解压的上传到Centos上,我在Centos上解压mysql不知道为什么少了rpm -ivh mysql-community-common-5.7.25-1.el6.x86_64.rpm包

    tar –xvf mysql-5.7.25-1.el6.x86_64.rpm-bundle.tar

    fb6fc1498995780b59414bfeb59c767e.png

    3.查看mysql依赖

    rpm -qa | grep mysql

    4.如果查看有mysql依赖,就删除mysql依赖,

    rpm -e --nodeps `rpm -qa | grep mysql`

    5.再次查是否有mysql依赖

    rpm -qa | grep mysql

    6.安装一定要按照顺序来

    第一个安装:  rpm -ivh mysql-community-common-5.7.25-1.el6.x86_64.rpm报了一个错误

    [root@localhost mysql-5.7.25]# rpm -ivh mysql-community-common-5.7.25-1.el6.x86_64.rpm

    warning: mysql-community-common-5.7.25-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

    Preparing... ########################################### [100%]

    file /usr/share/mysql/charsets/Index.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/armscii8.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/ascii.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/cp1250.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/cp1251.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/cp1256.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/cp1257.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/cp850.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/cp852.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/cp866.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/dec8.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/geostd8.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/greek.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/hebrew.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/hp8.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/keybcs2.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/koi8r.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/koi8u.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/latin1.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/latin2.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/latin5.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/latin7.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/macce.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/macroman.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/swe7.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    [root@localhost mysql-5.7.25]# file /usr/share/mysql/charsets/Index.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    /usr/share/mysql/charsets/Index.xml: XML document text

    from: cannot open `from' (No such file or directory)

    install: cannot open `install' (No such file or directory)

    of: cannot open `of' (No such file or directory)

    mysql-community-common-5.7.25-1.el6.x86_64: cannot open `mysql-community-common-5.7.25-1.el6.x86_64' (No such file or directory)

    conflicts: cannot open `conflicts' (No such file or directory)

    with: cannot open `with' (No such file or directory)

    file: cannot open `file' (No such file or directory)

    from: cannot open `from' (No such file or directory)

    package: cannot open `package' (No such file or directory)

    MariaDB-common-10.4.8-1.el7.centos.x86_64: cannot open `MariaDB-common-10.4.8-1.el7.centos.x86_64' (No such file or directory)

    原因:已存在MariaDB-common-10.4.8-1.el7.centos.x86_64的库(这是我以前安装MariaDB数据库,如果是别的也要根据对应的名字删除),所以需要先删除以前的库才能安装!

    执行强制卸载命令:

    rpm -e MariaDB-common-10.4.8-1.el7.centos.x86_64--nodeps

    然后查看:

    rpm –qa | grep mysql

    再继续安装

    rpm -ivh mysql-community-common-5.7.25-1.el6.x86_64.rpm

    [root@localhost mysql-5.7.25]# rpm -ivh mysql-community-common-5.7.25-1.el6.x86_64.rpm

    warning: mysql-community-common-5.7.25-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

    Preparing... ########################################### [100%]

    1:mysql-community-common ########################################### [100%]

    第二个安装:

    rpm -ivh mysql-community-libs-5.7.25-1.el6.x86_64.rpm

    [root@localhost mysql-5.7.25]# rpm -ivh mysql-community-libs-5.7.25-1.el6.x86_64.rpm

    warning: mysql-community-libs-5.7.25-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

    Preparing... ########################################### [100%]

    1:mysql-community-libs ########################################### [100%]

    第三个安装

    rpm -ivh mysql-community-client-5.7.25-1.el6.x86_64.rpm

    [root@localhost mysql-5.7.25]# rpm -ivh mysql-community-client-5.7.25-1.el6.x86_64.rpm

    warning: mysql-community-client-5.7.25-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

    Preparing... ########################################### [100%]

    1:mysql-community-client ########################################### [100%]

    第四个安装

    rpm -ivh mysql-community-server-5.7.25-1.el6.x86_64.rpm

    [root@localhost mysql-5.7.25]# rpm -ivh mysql-community-server-5.7.25-1.el6.x86_64.rpm

    warning: mysql-community-server-5.7.25-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

    Preparing... ########################################### [100%]

    1:mysql-community-server ########################################### [100%]

    You have new mail in /var/spool/mail/root

    第五个安装

    rpm -ivh mysql-community-devel-5.7.25-1.el6.x86_64.rpm

    [root@localhost mysql-5.7.25]# rpm -ivh mysql-community-devel-5.7.25-1.el6.x86_64.rpm

    warning: mysql-community-devel-5.7.25-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

    Preparing... ########################################### [100%]

    1:mysql-community-devel ########################################### [100%]

    7.使用命令启动mysql服务

    service mysqld start

    [root@localhost mysql-5.7.25]# service mysqld start

    Starting mysqld: [ OK ]

    [root@localhost mysql-5.7.25]#

    8.使用命令生成一个随机密码:grep "temporary password" /var/log/mysqld.log

    [root@localhost mysql-5.7.25]# grep "temporary password" /var/log/mysqld.log

    2020-04-07T12:32:39.276158Z 1 [Note] A temporary password is generated for root@localhost: >v>uyo:fg7.O

    [root@localhost mysql-5.7.25]#

    注意:密码是root@localhost:右边的字符串

    root@localhost: >v>uyo:fg7.O   这里生成的随机密码是:>v>uyo:fg7.O

    MySQL 会在 /var/log/mysqld.log 日志中生成一个随机密码,默认需要修改密码才能使用

    可以通过 vim  /var/log/mysqld.log 打开里面有一行这样的代码

    2020-04-07T12:32:39.276158Z 1 [Note] A temporary password is generated for root@localhost: >v>uyo:fg7.O

    9.修改密码,先登录mysql

    mysql -u root –p

    [root@localhost mysql-5.7.25]# mysql -u root -p

    Enter password:

    我这随机密码就是:>v>uyo:fg7.O

    10.登录成功

    [root@localhost log]# mysql -u root -p

    Enter password:

    Welcome to the MySQL monitor. Commands end with ; or \g.

    Your MySQL connection id is 12

    Server version: 5.7.25

    Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

    Oracle is a registered trademark of Oracle Corporation and/or its

    affiliates. Other names may be trademarks of their respective

    owners.

    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

    mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'wangqing';

    Query OK, 0 rows affected (0.01 sec)

    mysql>

    11.修改密码:

    mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '新密码';

    12.设置权限

    为了可以远程连接该数据库,需要设置相应的权限

    #任何主机

    mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '刚刚修改的密码' WITH GRANT OPTION;

    #指定主机

    mysql>GRANT ALL PRIVILEGES ON *.* TO 'xxxx'@’xx.xx.xx.xx’ IDENTIFIED BY 'xxxx' WITH GRANT OPTION;

    13.刷新权限

    mysql>flush privileges;

    这就完成了,可以用sql工具连接mysql了

    展开全文
  • 把下载的mysql安装包上传到Centos上解压mysql,我这是在Windows上解压的上传到Centos上,我在Centos上解压mysql不知道为什么少了rpm -ivh mysql-community-common-5.7.25-1.el6.x86_64.rpm包tar –...

    1.mysql-5.7.25-1.el6.x86_64.rpm-bundle.tar下载百度云资源

    提取码:ej1y

    2.把下载的mysql安装包上传到Centos上

    解压mysql,我这是在Windows上解压的上传到Centos上,我在Centos上解压mysql不知道为什么少了rpm -ivh mysql-community-common-5.7.25-1.el6.x86_64.rpm包

    tar –xvf mysql-5.7.25-1.el6.x86_64.rpm-bundle.tar

    fb6fc1498995780b59414bfeb59c767e.png

    3.查看mysql依赖

    rpm -qa | grep mysql

    4.如果查看有mysql依赖,就删除mysql依赖,

    rpm -e --nodeps `rpm -qa | grep mysql`

    5.再次查是否有mysql依赖

    rpm -qa | grep mysql

    6.安装一定要按照顺序来

    第一个安装:  rpm -ivh mysql-community-common-5.7.25-1.el6.x86_64.rpm报了一个错误

    [root@localhost mysql-5.7.25]# rpm -ivh mysql-community-common-5.7.25-1.el6.x86_64.rpm

    warning: mysql-community-common-5.7.25-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

    Preparing... ########################################### [100%]

    file /usr/share/mysql/charsets/Index.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/armscii8.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/ascii.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/cp1250.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/cp1251.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/cp1256.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/cp1257.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/cp850.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/cp852.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/cp866.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/dec8.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/geostd8.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/greek.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/hebrew.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/hp8.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/keybcs2.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/koi8r.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/koi8u.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/latin1.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/latin2.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/latin5.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/latin7.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/macce.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/macroman.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    file /usr/share/mysql/charsets/swe7.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    [root@localhost mysql-5.7.25]# file /usr/share/mysql/charsets/Index.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

    /usr/share/mysql/charsets/Index.xml: XML document text

    from: cannot open `from' (No such file or directory)

    install: cannot open `install' (No such file or directory)

    of: cannot open `of' (No such file or directory)

    mysql-community-common-5.7.25-1.el6.x86_64: cannot open `mysql-community-common-5.7.25-1.el6.x86_64' (No such file or directory)

    conflicts: cannot open `conflicts' (No such file or directory)

    with: cannot open `with' (No such file or directory)

    file: cannot open `file' (No such file or directory)

    from: cannot open `from' (No such file or directory)

    package: cannot open `package' (No such file or directory)

    MariaDB-common-10.4.8-1.el7.centos.x86_64: cannot open `MariaDB-common-10.4.8-1.el7.centos.x86_64' (No such file or directory)

    原因:已存在MariaDB-common-10.4.8-1.el7.centos.x86_64的库(这是我以前安装MariaDB数据库,如果是别的也要根据对应的名字删除),所以需要先删除以前的库才能安装!

    执行强制卸载命令:

    rpm -e MariaDB-common-10.4.8-1.el7.centos.x86_64--nodeps

    然后查看:

    rpm –qa | grep mysql

    再继续安装

    rpm -ivh mysql-community-common-5.7.25-1.el6.x86_64.rpm

    [root@localhost mysql-5.7.25]# rpm -ivh mysql-community-common-5.7.25-1.el6.x86_64.rpm

    warning: mysql-community-common-5.7.25-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

    Preparing... ########################################### [100%]

    1:mysql-community-common ########################################### [100%]

    第二个安装:

    rpm -ivh mysql-community-libs-5.7.25-1.el6.x86_64.rpm

    [root@localhost mysql-5.7.25]# rpm -ivh mysql-community-libs-5.7.25-1.el6.x86_64.rpm

    warning: mysql-community-libs-5.7.25-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

    Preparing... ########################################### [100%]

    1:mysql-community-libs ########################################### [100%]

    第三个安装

    rpm -ivh mysql-community-client-5.7.25-1.el6.x86_64.rpm

    [root@localhost mysql-5.7.25]# rpm -ivh mysql-community-client-5.7.25-1.el6.x86_64.rpm

    warning: mysql-community-client-5.7.25-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

    Preparing... ########################################### [100%]

    1:mysql-community-client ########################################### [100%]

    第四个安装

    rpm -ivh mysql-community-server-5.7.25-1.el6.x86_64.rpm

    [root@localhost mysql-5.7.25]# rpm -ivh mysql-community-server-5.7.25-1.el6.x86_64.rpm

    warning: mysql-community-server-5.7.25-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

    Preparing... ########################################### [100%]

    1:mysql-community-server ########################################### [100%]

    You have new mail in /var/spool/mail/root

    第五个安装

    rpm -ivh mysql-community-devel-5.7.25-1.el6.x86_64.rpm

    [root@localhost mysql-5.7.25]# rpm -ivh mysql-community-devel-5.7.25-1.el6.x86_64.rpm

    warning: mysql-community-devel-5.7.25-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

    Preparing... ########################################### [100%]

    1:mysql-community-devel ########################################### [100%]

    7.使用命令启动mysql服务

    service mysqld start

    [root@localhost mysql-5.7.25]# service mysqld start

    Starting mysqld: [ OK ]

    [root@localhost mysql-5.7.25]#

    8.使用命令生成一个随机密码:grep "temporary password" /var/log/mysqld.log

    [root@localhost mysql-5.7.25]# grep "temporary password" /var/log/mysqld.log

    2020-04-07T12:32:39.276158Z 1 [Note] A temporary password is generated for root@localhost: >v>uyo:fg7.O

    [root@localhost mysql-5.7.25]#

    注意:密码是root@localhost:右边的字符串

    root@localhost: >v>uyo:fg7.O   这里生成的随机密码是:>v>uyo:fg7.O

    MySQL 会在 /var/log/mysqld.log 日志中生成一个随机密码,默认需要修改密码才能使用

    可以通过 vim  /var/log/mysqld.log 打开里面有一行这样的代码

    2020-04-07T12:32:39.276158Z 1 [Note] A temporary password is generated for root@localhost: >v>uyo:fg7.O

    9.修改密码,先登录mysql

    mysql -u root –p

    [root@localhost mysql-5.7.25]# mysql -u root -p

    Enter password:

    我这随机密码就是:>v>uyo:fg7.O

    10.登录成功

    [root@localhost log]# mysql -u root -p

    Enter password:

    Welcome to the MySQL monitor. Commands end with ; or \g.

    Your MySQL connection id is 12

    Server version: 5.7.25

    Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

    Oracle is a registered trademark of Oracle Corporation and/or its

    affiliates. Other names may be trademarks of their respective

    owners.

    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

    mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'wangqing';

    Query OK, 0 rows affected (0.01 sec)

    mysql>

    11.修改密码:

    mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '新密码';

    12.设置权限

    为了可以远程连接该数据库,需要设置相应的权限

    #任何主机

    mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '刚刚修改的密码' WITH GRANT OPTION;

    #指定主机

    mysql>GRANT ALL PRIVILEGES ON *.* TO 'xxxx'@’xx.xx.xx.xx’ IDENTIFIED BY 'xxxx' WITH GRANT OPTION;

    13.刷新权限

    mysql>flush privileges;

    这就完成了,可以用sql工具连接mysql了

    展开全文
  • 资源包所带有的资源截图1.上传MySQL-client-5.5.55-1.linux2.6.x86_64.rpm、MySQL-server-5.5.55-1....使用rpm命令安装MySQL-server-5.5.55-1.linux2.6.x86_64.rpm,缺少perl依赖rpm -ivh MySQL-server-5.5.55-1.lin...

    资源包所带有的资源截图

    135471513_1_20180610044318582.jpg

    1.上传MySQL-client-5.5.55-1.linux2.6.x86_64.rpm、MySQL-server-5.5.55-1.linux2.6.x86_64.rpm到Linux上

    2.使用rpm命令安装MySQL-server-5.5.55-1.linux2.6.x86_64.rpm,缺少perl依赖

    rpm -ivh MySQL-server-5.5.55-1.linux2.6.x86_64.rpm

    135471513_2_20180610044318707.jpg

    3.安装perl依赖,上传6个perl相关的rpm包

    135471513_3_20180610044318770.jpg

    rpm -ivh perl-*

    4.看看是否已经存在mysql,存在删除,不存在跳过此步骤

    rpm -qa | grep mysql

    135471513_4_20180610044318941.jpg

    如果存在mysql

    卸载冲突的rpm包:

    rpm –e 查询出来的rpm文件名 –nodeps

    135471513_5_2018061004431920.jpg

    5.上传并安装libaio的rpm包

    rpm –ivh libaio-0.3.107-10.el6.x86_64.rpm

    6.再安装MySQL-client和MySQL-server

    rpm -ivh MySQL-client-5.5.55-1.linux2.6.x86_64.rpm

    rpm -ivh MySQL-server-5.5.55-1.linux2.6.x86_64.rpm

    7.启动MySQL服务,然后初始化MySQL

    service mysql start

    /usr/bin/mysql_secure_installation

    8.测试MySQL

    mysql -u root -p

    展开全文
  • 1、查看是否已安装mysqlrpm-qa|grep-imysql2、如果有,先卸载,如果不卸载,MySQL-server会安装失败,没有的话直接跳到第3步使用rpm -e --nodeps 命令强制卸载:rpm-e--nodepsmysql-libs-5.1.61-4.el6.i686rm-rf/var...

    1、查看是否已安装mysql

    rpm -qa | grep -i mysql

    2、如果有,先卸载,如果不卸载,MySQL-server会安装失败,没有的话直接跳到第3步

    使用rpm -e --nodeps 命令强制卸载:

    rpm -e --nodeps mysql-libs-5.1.61-4.el6.i686

    rm -rf /var/lib/mysql

    rm /etc/my.cnf

    查看是否还有mysql软件:

    rpm -qa|grep mysql

    有的话继续卸载删除

    3、下载mysql离线安装包

    可以使用wget命令直接下载。

    4、解压

    tar -xvf MySQL-5.6.26-1.linux_glibc2.5.x86_64.rpm-bundle.tar

    5、安装

    在RHEL系统中,必须先安装“MySQL-shared-compat-5.6.26-1.el6.i686.rpm”这个兼容包,然后才能安装server和client,否则安装时会出错。

    rpm -ivh MySQL-shared-compat-5.6.26-1.linux_glibc2.5.x86_64.rpm  # RHEL兼容包

    rpm -ivh MySQL-server-5.6.26-1.linux_glibc2.5.x86_64.rpm        # MySQL服务端程序

    rpm -ivh MySQL-client-5.6.26-1.linux_glibc2.5.x86_64.rpm        # MySQL客户端程序

    rpm -ivh MySQL-devel-5.6.26-1.linux_glibc2.5.x86_64.rpm         # MySQL的库和头文件

    rpm -ivh MySQL-shared-5.6.26-1.linux_glibc2.5.x86_64.rpm        # MySQL的共享库

    6、配置

    配置MySQL登录密码

    cat /root/.mysql_secret  # 获取MySQL安装时生成的随机密码

    service mysql start      # 启动MySQL服务

    mysql -uroot -p          # 进入MySQL,使用之前获取的随机密码

    SET PASSWORD FOR 'root'@'localhost' = PASSWORD('password');  # 在MySQL命令行中设置root账户的密码为password

    quit  # 退出MySQL命令行

    service mysql restart  # 重新启动MySQL服务

    参考:

    展开全文
  • 一、下载源码包http://cdn.mysql.com/archives/mysql-5.6/mysql-5.6.22.tar.gz二、准备工作卸载之前本机自带的MYSQL安装cmake,编译MYSQL 的工具yum install cmake三、解压源码包tar -zxv -f mysql-5.6.16.tar.gzcd ...
  • 工作问题记录————CentOS6离线安装Mysql5.7 1.下载mysql离线安装包: mysql-5.7.25-1.el6.x86_64.rpm-bundle.tar下载百度云资源: 百度云:https://pan.baidu.com/s/1Sfom_aNhTyZnR7KGTZIfFw 提取码:ej1y 2.传入...
  • Centos6 离线安装 MySQL5.5.55-1(附带安装包及 Perl 依赖包)资源包下载 https://pan.baidu.com/s/1U3myYp4GSmDUfZocMWI9FA 密码: xdac资源包所带有的资源截图1. 上传 MySQL-client-5.5.55-1.linux2.6.x86_64....
  • Centos6离线安装MySQL5.5.55-1(附带安装包及Perl依赖包)  资源包下载https://pan.baidu.com/s/1U3myYp4GSmDUfZocMWI9FA 密码:xdac 资源包所带有的资源截图 1.上传MySQL-client-5.5.55-1.linux...
  • CentOS6离线安装mysql数据库

    千次阅读 2018-05-18 11:02:26
    第一步:这里我们需要根据我们的操作系统版本下载数据库:CentOS_6下载:mysql-5.7.22-1.el6.x86_64.rpm-bundle.tarCentOS_7下载:mysql-5.7.17-1.el7.x86_64.rpm-bundle.tar下载地址:......
  • 资源包所带有的资源截图1.上传MySQL-client-5.5.55-1.linux2.6.x86_64.rpm、MySQL-server-5.5.55-1....使用rpm命令安装MySQL-server-5.5.55-1.linux2.6.x86_64.rpm,缺少perl依赖rpm -ivh MySQL-server-5.5.55-1.lin...
  • 系统信息: [root@ebs-40617 /]# cat /etc/redhat-...centOS6MySQL8.0.18 1.下载MySQL。 地址:https://dev.mysql.com/downloads/mysql/ 下载然后上传到Linux云服务器,或者直接wget下载。 cd /home/ ...
  • 资源包所带有的资源截图1.上传MySQL-client-5.5.55-1.linux2.6.x86_64.rpm、MySQL-server-5.5.55-1....使用rpm命令安装MySQL-server-5.5.55-1.linux2.6.x86_64.rpm,缺少perl依赖rpm -ivh MySQL-server-5.5.55-1.lin...
  • 资源包所带有的资源截图1.上传MySQL-client-5.5.55-1.linux2.6.x86_64.rpm、MySQL-server-5.5.55-1....使用rpm命令安装MySQL-server-5.5.55-1.linux2.6.x86_64.rpm,缺少perl依赖rpm -ivh MySQL-server-5.5.55-1.lin...
  •  yum remove mysql mysql-server mysql-libs mysql-server;  find / -name mysql 将找到的相关东西delete掉;  rpm -qa|grep mysql(查询出来的东东yum remove掉)  rpm -e mysql相关文件  2.下载安装包 ...
  • 1、查看是否已安装mysqlrpm-qa|grep-imysql2、如果有,先卸载,如果不卸载,MySQL-server会安装失败,没有的话直接跳到第3步使用rpm -e --nodeps 命令强制卸载:rpm-e--nodepsmysql-libs-5.1.61-4.el6.i686rm-rf/var...
  • 资源包所带有的资源截图1.上传MySQL-client-5.5.55-1.linux2.6.x86_64.rpm、MySQL-server-5.5.55-1....使用rpm命令安装MySQL-server-5.5.55-1.linux2.6.x86_64.rpm,缺少perl依赖rpm -ivh MySQL-server-5.5.55-1.lin...
  • 资源包所带有的资源截图 1.上传MySQL-client-5.5.55-1.linux2.6.x86_64.rpm、MySQL-server-5.5.55-1....使用rpm命令安装MySQL-server-5.5.55-1.linux2.6.x86_64.rpm,缺少perl依赖rpm -ivh MySQL-server-5.5.55-1.li...
  • 参考链接:CentOS7离线安装MySQL - 桔子在路上 - 博客园​www.cnblogs.com我是在windows 10操作系统上,先下好了MySQL的Linux版安装包,然后通过Xftp向虚拟机进行的传送,所以需要进行离线安装。具体的步骤1.删除...
  • 1.删除原有的mariadb,不然安装报错。rpm -qa|grep mariadbrpm -e --nodeps mariadb-libs2.在https://dev.mysql.com/downloads/mysql/选择为Red Hat Enterprise Linux 7 / ...直接下载mysql-5.7.21-1.el7.x86_6...
  • CentOS7离线安装MySQL8.0

    2019-09-25 16:13:56
    CentOS7离线安装MySQL8.0 卸载软件 rpm -e --nodeps 要卸载的软件包 root@jacky zookeeper]# rpm -e --nodeps java-1.6.0-openjdk-1.6.0.0-1.66.1.13.0.el6.i686 本文链接:...
  • centos7.6离线安装mysql-5.7.281、查看是否安装mysql2、命令查看 mariadb 的安装包3、创建安装文件夹4、移动到安装路径下5、解压6、查看 mysql 的安装包7、初始化及相关配置8、初始密码查询10、修改用户名(可选操作...
  • centos7离线安装mysql

    千次阅读 2020-06-29 20:44:25
    centos7安装mysql5.7 1.安装之前准备工作: 下载对应的安装包https://pan.baidu.com/s/1rLuiACHh-zr-mUeHss6JOw提取码:x126 包下面有对应的一键安装脚本,但是如果可能需要改动下里面的脚本还有配置文件才能...
  • 1、首先准备需要用到的MySQL压缩包 ...2、检查是否有旧版本的mysql包,有的centos镜像会默认携带 rpm -qa | grep mariadb [root@DTS mysql]# rpm -qa | grep mariadb mariadb-libs-5.5.65-1.el7.x86_
  • 由于centos服务器无法联网,无法直接更新yum源,而安装mysql5.7依赖更高版本的glibc,centos6.8的自带glibc2.12,因此有该安装步骤。 1.检查系统glibc的版本:strings /lib64/libc.so.6 | grep GLIBC 2.查找mysql...
  • 虚拟机centos7离线安装mysql

    千次阅读 2020-03-03 16:13:02
    1.官网下载安装包 找到自己要的版本,centos用red hat的 2.通过vmware共享文件夹或者远程软件传包到/root下 3.清除centos7自带的mariaDB ...rpm -e --nodeps mariadb-libs-5.5.56-2.el7.x86_6...
  • CentOS7离线安装mysql8.0并设置忽略大小写+远程连接1. 下载离线安装包2. 将tar压缩包上传到服务器3. 删除原有mariadb4. 检查 MySQL 是否已安装5. 解压缩mysql离线安装包6. 安装rpm包7.设置忽略大小写8. 初始化数据库...
  • 1.上传mysql安装包至服务器目录 /usr/local 官网:https://dev.mysql.com/downloads/mysql/ 百度云:https://pan.baidu.com/s/1KIYfwWkSmC07EGFsQzj0kg提取码:xnb6 2.解压安装包并改名称为mysql(注意命令中的...
  • # rpm -qa | grep mysql --查看系统之前是否已安装MySQL。 # rpm -e --nodeps mysql-libs-5.1.71-1.el6.x86_64 --执行删除语句 # rm -rf /var/lib/mysql* --善后处理 # rm -rf /usr/share/mysql* 2、安装MySQL ...

空空如也

空空如也

1 2 3 4 5 ... 8
收藏数 155
精华内容 62
关键字:

centos6离线安装mysql

mysql 订阅