安装MySql 5.7客户端

安装MySql 5.7客户端,第1张

wget https://repo.mysql.com//mysql80-community-release-el7-1.noarch.rpm

sudo yum localinstall mysql80-community-release-el7-1.noarch.rpm

8.0默认是enabled,其它版本默认是disabled.(enabled=0为disabled,1为enabled,其它的不要修改)

vim /etc/yum.repos.d/mysql-community.repo

# Enable to use MySQL 5.7

[mysql57-community]

name=MySQL 5.7 Community Server

baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql80-community]

name=MySQL 8.0 Community Server

baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/7/$basearch/

enabled=0

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

yum repolist enabled | grep mysql

yum install mysql-community-client

mysql community server 5.7 win10 怎么安装

win10 下安装、配置、启动mysql

1、下载http://dev.mysql.com/downloads/mysql/

2、Community >MySQL Community Server

3、Other Downloads: >Windows (x86, 32-bit), ZIP Archive

5、解压mysql-5.7.11-winx64.zip,解压在 D:\soft\mysql-5.7.11-winx64\mysql-5.7.11-winx64

6、在D:\soft\mysql-5.7.11-winx64\mysql-5.7.11-winx64目录下新建my.ini 文件,设置代码如下:

[mysql]

# 设置mysql客户端默认字符集

default-character-set=utf8

[mysqld]

#设置3306端口

port = 3306

# 设置mysql的安装目录

basedir=D:\mysql

# 设置mysql数据库的数据的存放目录

datadir=D:\mysql\data

# 允许最大连接数

max_connections=200

# 服务端使用的字符集默认为8比特编码的latin1字符集

character-set-server=utf8

# 创建新表时将使用的默认存储引擎

default-storage-engine=INNODB

#log-error=D:\mysql\mysql_log_err.txt

#log=D:\mysql\mysql_log.txt

#log-bin=d:/log/mysql/mysql_log_bin

#log-slow-queries= D:\mysql\mysql_log_slow.txt

7、安装mysql服务,以管理员身份执行cmd,

C:\WINDOWS\system32>d:

D:\>cd D:\soft\mysql-5.7.11-winx64\mysql-5.7.11-winx64\bin

D:\soft\mysql-5.7.11-winx64\mysql-5.7.11-winx64\bin>mysqld install (卸载用mysqld -remove)

Service successfully installed.

D:\soft\mysql-5.7.11-winx64\mysql-5.7.11-winx64\bin>

8、启动服务 net start mysql 本地计算机上的服务启动后停止。某些服务在未由其他服务或程序使用时将自动停止。

转用旧版本 mysql D:\soft\mysql_5.6.24_winx64\mysql-5.6.24-winx64

启动,提示:Windows 无法启动MySQL服务(位于 本地计算机上)。错误1067:进程意外终止

Windows 管理>时间查看器>自动以视图 >摘要页事件 提示:

Can't find messagefile 'D:\ oft\mysql_5.6.24_winx64\mysql-5.6.24-winx64\share\errmsg.sys'

For more information, see Help and Support Center at http://www.mysql.com.

D:\soft\被识别成D:\ oft\

修改mysql文件存放位置 D:\mysql

设置配置文件my.ini文件:

[mysql]

# 设置mysql客户端默认字符集

default-character-set=utf8

[mysqld]

#设置3306端口

port = 3306

# 设置mysql的安装目录

basedir=D:\mysql

# 设置mysql数据库的数据的存放目录

datadir=D:\mysql\data

# 允许最大连接数

max_connections=200

# 服务端使用的字符集默认为8比特编码的latin1字符集

character-set-server=utf8

# 创建新表时将使用的默认存储引擎

default-storage-engine=INNODB

#log-error=D:\mysql\mysql_log_err.txt

#log=D:\mysql\mysql_log.txt

#log-bin=d:/log/mysql/mysql_log_bin

#log-slow-queries= D:\mysql\mysql_log_slow.txt

并把D:\mysql\my.ini文件复制到C:\Windows 下面,启动mysql成功

9、设置环境变量:D:\mysql\bin

10、设置密码,新安装的root是没有密码,mysql -u root 进入mysql,执行语句:set password = password('123456')设置密码

C:\Users\alex>mysql -u root

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

Your MySQL connection id is 4

Server version: 5.6.24 MySQL Community Server (GPL)

Copyright (c) 2000, 2015, 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>set password = password('123456')

Query OK, 0 rows affected (0.02 sec)

mysql>


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/8713214.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-20
下一篇 2023-04-20

发表评论

登录后才能评论

评论列表(0条)

保存