-
Windows 离线安装 MySQL
2018-09-01 23:44:07Windows 电脑离线安装 MySQL 服务准备 官网下载安装压缩包:https://dev.mysql.com/downloads/mysql/5.7.html#downloads 备注:下载社区版5.7即可,企业版需要收费并且还需要登陆才能下载。 安装开始 1、...Windows 电脑离线安装 MySQL 服务准备
官网下载安装压缩包:https://dev.mysql.com/downloads/mysql/5.7.html#downloads
备注:下载社区版5.7即可,企业版需要收费并且还需要登陆才能下载。
安装开始
1、官网下载压缩包安装文件,如:mysql-5.7.19-winx64.zip
2、将压缩包解压至本地目录,如:D:\tools\mysql-5.7.19-winx64
3、D:\tools\mysql-5.7.19-winx64 添加 my.ini 配置文件
[client] port=3306 default-character-set=utf8 [mysqld] # 设置为自己MYSQL的安装目录 #basedir=D:\tools\mysql-5.7.23-winx64 # 设置为MYSQL的数据目录 #datadir=D:\tools\mysql-5.7.23-winx64\data #port=3306 character_set_server=utf8 #sql_mode=NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER # 开启查询缓存 #explicit_defaults_for_timestamp=true # 第一次启动MYSQL打开这行(一定放在末尾),可以免密登陆,方便登录设置root密码 skip-grant-tables
4、使用管理员运行命令行,如:Windows 10 使用 win 键 + x 键,选择 Windows PowerShell(管理员):
5、进入解压目录:
cd D: cd D:\tools\mysql-5.7.23-winx64\bin
6、执行安装命令:
mysqld.exe install
7、第一次安装,数据目录没有初始化,需要运行如下命令,否则不能启动
mysqld.exe --initialize
8、启动 mysql 服务:
# 管理员模式下执行命令 net start mysql # 或者通过 Windwos 服务窗口手动启动 # win 键 + R 键 # 输入命令 services.msc # 选择 MySQL 服务,右键启动
9、配置 mysql 环境变量,使可以使用 mysql 命令(可不配置):
# 新建 MYSQL_HOME=D:\tools\mysql-5.7.23-winx64\ # 编辑 Path(注意前后分号),末尾增加 ;%MYSQL_HOME%\bin\;
10、进入 mysql ,命令:
# 密码默认为空 mysql -u root -p
11、设置 root 密码:
use mysql update user set authentication_string=password('root') where user='root';
12、注释 skip-grant-tables 配置,每次登陆需要需要密码:
net stop mysql net start mysql # 需要如如密码才能登录 mysql -u root -p
-
windows电脑离线安装mysql 8_windows下离线安装mysql8.0服务(支持多个安装,端口不同就可以)...
2021-02-03 17:59:121.官网下载 mysql文件。官网下载链接:https://dev.mysql.com/downloads/mysql/ 选择mysql下载的系统版本。此处可以下载MSI安装包,图简单的朋友可以下载,然后“下一步”安装即可。此处下载ZIP压缩包版(这次记录ZIP...1.官网下载 mysql文件。官网下载链接:https://dev.mysql.com/downloads/mysql/
选择mysql下载的系统版本。
此处可以下载MSI安装包,图简单的朋友可以下载,然后“下一步”安装即可。
此处下载ZIP压缩包版(这次记录ZIP压缩包安装方法)
2.解压如下:
3.修改my.ini的配置.若该解压文件夹下无my.ini文件,则新建my.ini。配置如下:
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
[mysqld]
# 设置3306端口
port=3309
# 设置mysql的安装目录
basedir=D:\devsoft\mysql-8.0.15-winx64
# 设置mysql数据库的数据的存放目录
datadir=D:\devsoft\mysql-8.0.15-winx64\Data
# 允许最大连接数
max_connections=200
# 允许连接失败的次数。这是为了防止有人从该主机试图攻击数据库系统
max_connect_errors=10
# 服务端使用的字符集默认为UTF8
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
# 默认使用“mysql_native_password”插件认证
default_authentication_plugin=mysql_native_password
sql_mode = 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'
[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8
[client]
# 设置mysql客户端连接服务端时默认使用的端口
port=3309
default-character-set=utf8
4.修改my.ini的配置
5.修改后的my.ini
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
[mysqld]
# 设置3306端口
port=3309
# 设置mysql的安装目录
basedir=D:\devsoft\mysql-8.0.15-winx64
# 设置mysql数据库的数据的存放目录
datadir=D:\devsoft\mysql-8.0.15-winx64\Data
# 允许最大连接数
max_connections=200
# 允许连接失败的次数。这是为了防止有人从该主机试图攻击数据库系统
max_connect_errors=10
# 服务端使用的字符集默认为UTF8
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
# 默认使用“mysql_native_password”插件认证
default_authentication_plugin=mysql_native_password
sql_mode = 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'
[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8
[client]
# 设置mysql客户端连接服务端时默认使用的端口
port=3309
default-character-set=utf8
6.在环境变量path中加入D:\devsoft\mysql-8.0.15-winx64\bin
7.初始化数据库,生成随机root密码;创建MySQL8.0服务,服务名为:mysql8-meet;修改root密码;使用新密码登录mysql。
①以管理员身份运行cmd
②输入:cd C:\Program Files\MySQL\mysql-8.0.11-meet\bin 进入mysql的bin文件夹
③输入:mysqld --initialize
④查找随机生成的root密码!在C:\Program Files\MySQL\mysql-8.0.11-meet\Data文件夹下找到 *.err文件,用notepad++工具打开随机密码:udURRomgU8=p
⑤输入:mysqld -install mysql8-meet
⑥启动服务,输入:net start mysql8
⑦连接数据库,修改随机密码:
ALTER user 'root'@'localhost' IDENTIFIED BY 'root';
(注:mysql 5.7.9以后废弃了password字段和password()函数,因此百度到的set password = password('root') 的方法是错误的。)
然后执行:
flush privileges;
⑧用navicat工具连接数据库,输入新设置的root密码。
-
centos 离线安装 mysql_CentOS6离线安装mysql-5.7.25
2021-01-20 22:09:12把下载的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
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了
-
centos 离线安装mysql_CentOS6离线安装mysql-5.7.25
2021-01-18 22:12:13把下载的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
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了
-
Windows Server离线安装mysql-5.7
2018-09-15 19:58:55本文是基于Windows Server系统环境,安装和测试MySQL: Windows Server mysql-5.7.23-winx64.zip for Windows 一、下载mysql-5.7离线安装包 访问网页https://dev.mysql.com/downloads/mysql/,由于当前的... -
Redhat7离线安装mysql_linux 离线安装mysql7或者8
2021-02-07 02:52:05安装方式:官网下载压缩包进行安装1.下载jdk8登录网址:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html选择对应jdk版本下载。(可在Windows下下载完成后,通过文件夹共享到... -
ubuntu离线安装mysql8.0_Ubuntu18.04-离线安装mysql-8.0
2021-01-19 21:31:101. 下载需要的deb包该安装方式是解决Ubuntu下不能联网时安装MySQL8.0。在windows有网情况下下载,通过U盘、桥接、共享目录等方式将该包上传至Ubuntu。链接:https://pan.baidu.com/s/1lrehZXaJSP93rVu0jMYTRg提取码... -
Windows系统离线安装MySQL 详细教程
2020-07-30 10:58:581、安装MySQL MySQL安装分两种,一种事 msi 格式的安装包,一种是 zip 格式的免安装压缩包。msi 格式的直接双击安装即可,默认安装在 C:\Program Files\MySQL\MySQL Server 8.0.20 目录中,笔者主要介绍 zip 格式的... -
windows电脑离线安装mysql 8_windows环境下手动安装Mysql8
2021-02-03 17:59:121.下载zip包,解压到c:\java_env_mysql8下,并把c:\java_env_mysql8\bin放入到系统path变量中2.编写my.ini文件,放置于c:\java_env_mysql8\下,内容如下:[mysqld]# set basedir to your installation pathbasedir=C:... -
mysql 免安装_Windows 10 离线安装 MySQL
2020-12-05 09:53:49一、下载 MySQL 5.7 免安装版本二、解压到指定目录例如 D:MySQLmysql-5.7.20-winx64三、环境变量配置右击我的电脑 --> 属性 --> 高级系统设置 --> 环境变量找到系统Path ,单击编辑 ,添加值 (解压后的bin... -
[mysql知识]Windows Server离线安装mysql-5.7
2019-10-14 15:57:59https://downloads.mysql.com/archives/installer/ -
mysql离线安装 window_Windows10上安装离线版mysql 8.0.3,设置密码,修改密码
2020-12-24 04:20:47现在的mysql都是安装到C盘里,没有选择,对于C盘空间不多的人情况非常糟糕,所以在这里记录一下本人的安装离线版本经历,Windows10上安装离线版mysql 8.0.3步骤如下:1、下载离线安装包并配置my.ini下载离线安装包并... -
xp离线安装mysql_Windows XP环境下安装单机MySQL Cluster
2021-03-07 09:21:11前前后后折腾了3、4天,今天终于把MySQL Cluster安装好了。呵呵,没办法,基础不好。下面总结一下,防止自己哪天给忘了。1、下载二进制免安装版的MySQL Cluster,版本GPL-7.3.2。直接在MySQL的官网下载即可,很方便... -
windows下离线安装mysql8.0服务(支持多个安装,端口不同就可以)
2019-04-22 20:46:001.官网下载 mysql文件。官网下载链接:https://dev.mysql.com/downloads/mysql/ 选择mysql下载的系统版本。 此处可以下载MSI安装包,图简单的朋友可以下载,然后“下一步”安装即可。 此处下载ZIP压缩包版... -
windows10系统-3-离线安装mysql8
2020-07-01 17:42:26(1)下载地址 https://dev.mysql.com/downloads/mysql/ mysql-8.0.19-winx64.zip (2)解压到D:\mysql-8.0.19-winx64 ...#设置mysql的安装目录 basedir=D:\mysql-8.0.19-winx64 #设置mysql数据库的数据的 -
docker 离线安装 mysql_Oracle数据库之docker 离线环境安装oracle
2021-01-26 22:06:18本文主要向大家介绍了Oracle数据库之docker 离线环境安装oracle,通过具体的内容向大家展现,希望对大家学习Oracle数据库有所帮助。因测试需要,需在内网的测试环境搭建一套docker Oracle 11g环境进行测试,测试环境... -
xp离线安装mysql_在Windows XP下手动安装Apache+MySQL+PHP环境 要点
2021-01-25 21:28:01在windos下,对dll文件系统...第一种是:把需要调用dll文件复制到C:\windows\ system32\(如果是Windows 2000操作系统,则为C:\WINNT\ system32\)目录下。第二种是:把.dll后缀文件所在的文件夹的地址,追加到系统的p... -
linux x64 mysql 安装_linux 离线安装mysql7或者8
2021-03-03 16:20:52安装方式:官网下载压缩包进行安装1.下载jdk8登录网址:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html选择对应jdk版本下载。(可在Windows下下载完成后,通过文件夹共享到... -
离线安装mysql5.6及依赖_mysql数据库5.6.45安装后的配置(离线安装包版)
2020-12-20 00:38:36二、windows10下的配置(1) 环境变量配置打开控制面板=>系统和安全=>系统=>高级系统设置,选择环境变量,在系统变量中找到path,编辑该选项。 第一行是oracle数据库的环境变量path配置,上图中最后一行是jdk的... -
离线安装 go mysql_windows 安装Go 环境 搭建Mysql数据库连接
2021-01-26 02:42:23并且 连接上了 mysql 数据库。但是 开发 还是 在windows 上面的比较多。所以要研究下 windows 下如何弄 。需要使用一个mingw 的环境 。 要使用make 命令官网:http://www.mingw.org/下载... -
pip离线包安装mysql_Windows下pip 离线包安装
2021-01-30 02:31:41pip在线安装十分方便,有时候某些服务器并没有直接联网,需要下载好安装包上传到服务器上进行安装,不经常用,还是有点小麻烦的。安装Python之后,将下载好的安装包包放在Python安装的根目录下使用pip install ... -
mysql离线安装 window_mysql 免安装完美实现windows安装
2020-12-24 04:22:151.官网下载mysql免安装版数据库 https://dev.mysql.com/downloads/mysql/2.解压数据库放到指定的盘符3.创建ini文件 建议创建 里面的设置信息可以自行设置(可以去百度搜索一下)4.设置mysql的环境记得指定要对应的bin... -
mysql离线安装 window_window、linux、windows环境下mysql的安装方法
2020-12-24 04:22:36安装第一步:打开网址,https://www.mysql.com,点击downloads之后跳转到https://www.mysql.com/downloads/选择Community选项第二步: 第一步结束后程序会跳转到https://dev.mysql.com/downloads/网址,点击MySQL ... -
Windows下mysql的离线安装与配置
2019-05-12 19:40:351.下载。 官网:https://www.mysql.com/downloads/ 地址:https://dev.mysql.com/downloads/mysql/ 2.解压复制,创建my.ini文件,文件内容: ...MYSQL_HOME C:\DEV\mysql Path: %MYSQL_HOME%\bin 4... -
【MySQL学习】1、MySQL搭建环境(Windows、Linux在线/离线)安装
2020-09-11 15:24:25文章目录1、Windows安装MySQL2、Linux安装MySQL(1)Linux在线安装MySQL(2)Linux离线安装MySQL3、创建测试数据库4、更多细节学习 1、Windows安装MySQL 2、Linux安装MySQL (1)Linux在线安装MySQL (2)Linux离线... -
ccs安装多版本编译器离线_windows 安装mysql多版本 主从复制
2021-01-09 05:52:05作者:chenjunbiao出自:SegmentFault 思否原文:segmentfault.com/a/1190000025135698在windows7下安装mysql以下版本:1、mysql-5.7.282、mysql-8.0.20:主库3、mysql-8.0.20:从库一、mysql-5.7.28安装和启用1.1 ... -
Linux/Windows下JDK、Tomcat、MySQL的离线安装,jar/war包的打包以及部署
2020-08-18 09:42:30注意: 资料里的文档采用的是office2013,低版本的office可能会出现兼容问题。 windows下JDK及Tomcat布置,htpps部署===外置tomcat的布置 ...jar/war包的打包以及部署:压缩包中的Linux离线安装Tomcat.doc文档 ... -
Linux离线用yum安装MySQL5.7数据库
2019-05-07 14:07:23Linux离线用yum安装MySQL5.7数据库1、 Windows环境下载mysql的安装包2、 Linux环境下yum安装源配置3、 MySQL5.7安装4、 MySQL5.7初始化及启动 1、 Windows环境下载mysql的安装包 MySQL5.7与5.6相比,在安装完后... -
CDH5.16:离线安装部署
2019-07-29 20:00:00按量付费2.2 Windows配置hosts文件2.3 Linux配置hosts文件2.4 关闭所有节点的防火墙及清空规则2.5 关闭所有节点的selinux2.6 设置所有节点时钟同步2.7 部署集群的JDK2.8 hadoop001节点离线部署MySQL5.72.9 创... -
MySQL数据库离线包安装与注册
2017-10-23 15:29:00本文主要介绍了MySQL数据库的离线安装和将MySQL服务注册为Windows应用服务的主要步骤。 1、下在安装程序包 MySQL Community Server 5.6.15 官方下载地址http://dev.mysql.com/downloads/mysql/ 2、解压安装包 3...