安装版MySQL是不能一键安装的,下载下来是压缩包,解压后只要进行相关配置就可以正常使用;

文章主要是记录一下,以防自己忘记;

1、首先在mysql官网--http://dev.mysql.com/downloads/mysql/  下载mysql;

2、下载后解压到对应路径

我是放在 D:\mysql-5.7.14-winx64\ 里面,解压完后改名,可以自己进行重命名;

3、配置环境变量

找到--高级系统变量--环境变量--系统变量

新建环境变量:变量名 MYSQL_HOME,变量值 D:\mysql-5.7.14-winx64;

找到path--编辑--在最后面加上 ;%MYSQL_HOME%/bin ;

(这是我的mysql的bin目录,请设置自己电脑上相应的目录); 然后确定保存;

4,检查mysql目录下有没有data目录;

如果有data目录,忽略本点;

如果没有,win+r 打开运行,输入cmd进入命令窗;

进入mysql所在盘符。比如:d:

然后cd到mysql的bin目录,执行如下语句: mysqld --initialize-insecure --user=mysql ;data目录就生成成功了

5,配置mysql目录内的  my-default.ini (没有就新建个)

在[mysqld]下,修改以下三个参数,默认是用#注释的,去掉#;

basedir = D:\mysql-5.7.14-winx64

datadir = D:\mysql-5.7.14-winx64\data

port = 3306

注意:basedir   和datadir是我本地mysql的目录,请设置自己电脑上相应的目录;

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/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]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
basedir = E:\mysql-5.7.16-winx64
datadir = E:\mysql-5.7.16-winx64\data
port = 3306
# server_id = .....

# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M

#sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
ql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
loose-default-character-set = utf8
character_set_server = utf8
[client]
loose-default-character-set = utf8
port = 3306
user=root
password=admin

6,安装;

用管理员权限打开系统命令窗口,

输入:mysqld --install

提示service successfully installed安装成功;

7,停止和启动mysql

启动:net  start  mysql

停止:net  stop  mysql

8,进入mysql以及修改密码

在mysql目录下,编辑 my-default.ini

在[mysqld]下添加一行     skip-grant-tables     暂时取消密码;

直接输入:SET PASSWORD = PASSWORD('你的新密码');

重启mysql,用 mysql -uroot -p123456。

########

其他更改密码方法

1,重启mysql,;

2,输入 mysql -uroot -p   按回车,如果提示输入密码,直接回车即可;

, 3,登陆成功后,输入   update mysql.user set authentication_string=password('123456') where user='root' and Host = 'localhost';    将密码先修改为123456;

4,输入 flush privileges;刷新保存;

5,删除  my-default.ini 中刚刚添加的   skip-grant-tables   保存;

6,exit;或quit; 退出mysql;

7,重启mysql;

8,使用新密码登陆:  mysql -uroot -p123456   回车即可登陆成功;

9,ok了!

mysql 5.7.16 忘记root 密码 如何修改root密码

今天在电脑上安装  mysql5.7.16 (压缩包)时,在初始化data文件夹之后,没有记住密码,DOS框没有显示,没办法,为了学习一下怎么修改密码,在网上找了好多方法去解决,最终还是解决了,下面来看一下这种方法的具体操作:

    1. 关闭正在运行的MySQL服务。 

    2. 打开DOS窗口,转到mysql\bin目录

    3. 输入mysqld --skip-grant-tables 回车
            --skip-grant-tables 的意思是启动MySQL服务的时候跳过权限表认证。 

    4. 再开一个DOS窗口(因为刚才那个DOS窗口已经不能动了),转到mysql\bin目录。 

    5. 输入mysql回车,如果成功,将出现MySQL提示符 >。 

    6. 连接权限数据库: use mysql;  (别忘了最后加分号) 。

    7. 改密码:update user set password=password("123") where user="root"; (别忘了最后加分号) 。 

    如果修改密码出现 
    **mysql修改密码错误 ERROR 1054 (42S22)**

    则使用 mysql>update mysql.user set authentication_string=password('123456') where user='root' and Host ='localhost';
 
  通过上面的修改,root密码已经修改成功了,此时你如果去启动mysql服务时,服务  应该会启动不了,我的办法是从新启动了电脑,从新启动服务,此时  mysql服务可以正常启
动,  此时 通过 navicat 可以以新的密码连接,或者通过 mysql命令行来进入数据库。
mysql-5.7.10-winx64 MySQL服务无法启动,服务没有报告任何错误的解决办法
宛珩 发表于10个月前
 
 
 
 
原mysql-5.7.10-winx64 MySQL服务无法启动,服务没有报告任何错误的解决办法
  • 发表于 10个月前
  • 阅读 3555
  • 收藏 4
  • 点赞 3
  • 评论 1
总结报错原因: 
在my.init文件下新增data目录(datadir = F:\mysqldata ) 

最新解压版本的mysql 解压安装的时候报错 
D:\mysql\mysql-5.7.10-winx64\bin>net start mysql 
MySQL 服务正在启动 .... 
MySQL 服务无法启动。 

服务没有报告任何错误。 

请键入 NET HELPMSG 3534 以获得更多的帮助。 

  
  
mysql下面是没有data文件夹的,此文件夹不需要自己建 
  
D:\mysql\mysql-5.7.10-winx64\bin> mysqld --console 
2015-12-21T07:25:01.465815Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 
2015-12-21T07:25:01.465815Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They willbe merged with strict mode in a future release. 
2015-12-21T07:25:01.465815Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set. 
2015-12-21T07:25:01.465815Z 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path. 
2015-12-21T07:25:01.467815Z 0 [Note] mysqld (mysqld 5.7.10-log) starting as process 3708 ... 
2015-12-21T07:25:01.491816Z 0 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=PC201305252052-bin' to avoid this problem. 
2015-12-21T07:25:01.527818Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions 
2015-12-21T07:25:01.528818Z 0 [Note] InnoDB: Uses event mutexes 
2015-12-21T07:25:01.531819Z 0 [Note] InnoDB: _mm_lfence() and _mm_sfence() are used for memory barrier 
2015-12-21T07:25:01.535819Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3 
2015-12-21T07:25:01.540819Z 0 [Note] InnoDB: Number of pools: 1 
2015-12-21T07:25:01.544819Z 0 [Note] InnoDB: Not using CPU crc32 instructions 
2015-12-21T07:25:01.654826Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M 
2015-12-21T07:25:01.705829Z 0 [Note] InnoDB: Completed initialization of buffer pool 
2015-12-21T07:25:01.834836Z 0 [Note] InnoDB: Highest supported file format is Barracuda. 
2015-12-21T07:25:01.991845Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables 
2015-12-21T07:25:01.994845Z 0 [Note] InnoDB: Setting file '.\ibtmp1' size to 12MB. Physically writing the file full; Please wait ... 
2015-12-21T07:25:02.264861Z 0 [Note] InnoDB: File '.\ibtmp1' size is now 12 MB. 
2015-12-21T07:25:02.275861Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 
96 redo rollback segment(s) are active. 
2015-12-21T07:25:02.276861Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active. 
2015-12-21T07:25:02.284862Z 0 [Note] InnoDB: Waiting for purge to start 
2015-12-21T07:25:02.335865Z 0 [Note] InnoDB: 5.7.10 started; log sequence number 1209980 
2015-12-21T07:25:02.338865Z 0 [Note] Plugin 'FEDERATED' is disabled. 
2015-12-21T07:25:02.339865Z 0 [Note] InnoDB: Loading buffer pool(s) from F:\mysqldata\ib_buffer_pool 
2015-12-21T07:25:02.339865Z 0 [Note] InnoDB: not started mysqld: Table 'mysql.plugin' doesn't exist 
2015-12-21T07:25:02.348865Z 0 [Note] InnoDB: Buffer pool(s) load completed at 151221 15:25:02 
2015-12-21T07:25:02.351865Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 
2015-12-21T07:25:02.396868Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened. 
2015-12-21T07:25:02.401868Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key 
2015-12-21T07:25:02.402868Z 0 [Note] Server hostname (bind-address): '*'; port:3306 
2015-12-21T07:25:02.415869Z 0 [Note] IPv6 is available. 
2015-12-21T07:25:02.416869Z 0 [Note]   - '::' resolves to '::'; 
2015-12-21T07:25:02.419869Z 0 [Note] Server socket created on IP: '::'. 
2015-12-21T07:25:02.430870Z 0 [Warning] Failed to open optimizer cost constant tables 

2015-12-21T07:25:02.436870Z 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist 
2015-12-21T07:25:02.440871Z 0 [ERROR] Aborting 

2015-12-21T07:25:02.441871Z 0 [Note] Binlog end 
2015-12-21T07:25:02.457872Z 0 [Note] Shutting down plugin 'ngram' 
2015-12-21T07:25:02.457872Z 0 [Note] Shutting down plugin 'partition' 
2015-12-21T07:25:02.460872Z 0 [Note] Shutting down plugin 'BLACKHOLE' 
2015-12-21T07:25:02.463872Z 0 [Note] Shutting down plugin 'ARCHIVE' 
2015-12-21T07:25:02.468872Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA' 
2015-12-21T07:25:02.468872Z 0 [Note] Shutting down plugin 'MRG_MYISAM' 
2015-12-21T07:25:02.475873Z 0 [Note] Shutting down plugin 'MyISAM' 
2015-12-21T07:25:02.476873Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL' 
2015-12-21T07:25:02.480873Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES' 

2015-12-21T07:25:02.482873Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES' 
2015-12-21T07:25:02.493874Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS' 
2015-12-21T07:25:02.495874Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN' 
2015-12-21T07:25:02.498874Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS' 
2015-12-21T07:25:02.503874Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS' 
2015-12-21T07:25:02.509875Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES' 
2015-12-21T07:25:02.513875Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS' 
2015-12-21T07:25:02.518875Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES' 
2015-12-21T07:25:02.521875Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE' 
2015-12-21T07:25:02.524875Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE' 
2015-12-21T07:25:02.528876Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG' 
2015-12-21T07:25:02.531876Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED' 
2015-12-21T07:25:02.537876Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED' 
2015-12-21T07:25:02.539876Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD' 
2015-12-21T07:25:02.542876Z 0 [Note] Shutting down plugin 'INNODB_METRICS' 
2015-12-21T07:25:02.545877Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO' 
2015-12-21T07:25:02.553877Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS' 
2015-12-21T07:25:02.555877Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU' 
2015-12-21T07:25:02.558877Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE' 
2015-12-21T07:25:02.561878Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET' 
2015-12-21T07:25:02.563878Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX' 

2015-12-21T07:25:02.566878Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET' 
2015-12-21T07:25:02.572878Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM' 
2015-12-21T07:25:02.574878Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET' 
2015-12-21T07:25:02.577878Z 0 [Note] Shutting down plugin 'INNODB_CMP' 
2015-12-21T07:25:02.580879Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS' 
2015-12-21T07:25:02.582879Z 0 [Note] Shutting down plugin 'INNODB_LOCKS' 
2015-12-21T07:25:02.584879Z 0 [Note] Shutting down plugin 'INNODB_TRX' 
2015-12-21T07:25:02.586879Z 0 [Note] Shutting down plugin 'InnoDB' 
2015-12-21T07:25:02.587879Z 0 [Note] InnoDB: FTS optimize thread exiting. 
2015-12-21T07:25:02.589879Z 0 [Note] InnoDB: Starting shutdown... 
2015-12-21T07:25:02.690885Z 0 [Note] InnoDB: Dumping buffer pool(s) to F:\mysqldata\ib_buffer_pool 
2015-12-21T07:25:02.698885Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 151221 15:25:02 
2015-12-21T07:25:03.850951Z 0 [Note] InnoDB: Shutdown completed; log sequence number 1209999 
2015-12-21T07:25:03.853951Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1" 
2015-12-21T07:25:03.863952Z 0 [Note] Shutting down plugin 'MEMORY' 
2015-12-21T07:25:03.866952Z 0 [Note] Shutting down plugin 'CSV' 
2015-12-21T07:25:03.876953Z 0 [Note] Shutting down plugin 'sha256_password' 
2015-12-21T07:25:03.879953Z 0 [Note] Shutting down plugin 'mysql_native_password' 
2015-12-21T07:25:03.882953Z 0 [Note] Shutting down plugin 'binlog' 
2015-12-21T07:25:03.892954Z 0 [Note] mysqld: Shutdown complete 

  
  
D:\mysql\mysql-5.7.10-winx64\bin> mysqld --initialize 
2015-12-21T07:28:50.310904Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 
2015-12-21T07:28:50.311904Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They willbe merged with strict mode in a future release. 
2015-12-21T07:28:50.311904Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set. 
2015-12-21T07:28:50.318904Z 0  [ERROR] --initialize specified but the data directory has files in it. Aborting . 
2015-12-21T07:28:50.324905Z 0  [ERROR] Aborting 

  
  
上面的错误是自己建了data文件夹之后 用 mysqld  --initialize报错。 
  
删除之前建的data文件夹,然后注释my.init文件下的datadir,由mysql自己创建即可。 
D:\mysql-5.7.10-winx64\bin>mysqld  --initialize 
D:\mysql-5.7.10-winx64\bin>net start mysql 
MySQL 服务正在启动 . 
MySQL 服务已经启动成功。

mysq安装以及修改密码的更多相关文章

  1. mysql5.7安装和修改密码

    mysql5.7安装 第一 下载 https://downloads.mysql.com/archives/community/ 首先下载mysql5.7.18zip安装包 根据电脑配置选择32/64 ...

  2. mac 安装mysql 修改密码

    我草!!! 上网查资料,安装mysql,一大推废话,简直就是他妈的瞎扯淡,真是能他妈的瞎编,草! 为了不让后面的同学看到那些狗屁不通的资料,我把自己安装mysql的步骤,以及修改mysql密码的方法梳 ...

  3. mysql-8.0-winx64安装以及修改密码

    一.下载安装包(https://dev.mysql.com/downloads/mysql/) 二.添加my.ini配置文件 打开刚刚解压的文件夹 C:\mysql-8.0.16-winx64,在该文 ...

  4. mysql安装及修改密码

    MySQL5.7更改密码时出现ERROR 1054 (42S22): Unknown column 'password' in 'field list' C:\Users\Administrator& ...

  5. day40——数据库、数据库分类、安装、修改密码、字符集编码、简单语句介绍

    day40 详情请看:https://www.cnblogs.com/clschao/articles/9907529.html 数据库 数据库 简而言之可视为电子化的文件柜--存储电子文件的处所,用 ...

  6. CentOS7 安装MySQL8修改密码

    1. 添加MySQL8的本地源 执行以下命令获取安装MySQL源 [root@virde ~]# wget https://repo.mysql.com//mysql80-community-rele ...

  7. mysql安装与修改密码

    数据库基本概念:数据的仓库 数据库服务器-->数据库-->表-->记录-->属性(列,字段) unix下数据库服务安装: apt-get install -y mysql-se ...

  8. Linux下的 Mysql 8.0 yum 安装 并修改密码

    1.MySQL版本: mysql> select @@version;+-----------+| @@version |+-----------+| 8.0.18 |+-----------+ ...

  9. Mysql,zip格式安装、修改密码、建库

    Mysql,zip格式 1. Mysql 主目录最好别带有"- ."之类的字符 2. Mysql 配置环境变量 Path 环境变量后加上 mysql解压路径:eg:E:\mysql ...

随机推荐

  1. GPS开发之知识储备(NMEA0183)

    GPS是英文Global Positioning System(全球定位系统)的简称. NMEA0183(http://files.cnblogs.com/files/libra13179/NMEA0 ...

  2. Maven的包依赖冲突可引发java.lang.IncompatibleClassChangeError错误

    新版API上线后,发现LOG文件没有正常输出.查看Tomcat的Log文件发现如下的错误信息 May , :: AM com.sun.xml.ws.server.sei.EndpointMethodH ...

  3. Django 之Model(ORM)

    app01.models.py中写类 python manage.py makemigrations python manage.py migrate python3 manage.py create ...

  4. 【232】◀▶ IDL显示地理图像

    参考: 01   IMAGE 将图像数据以图形窗体的形式显示. 02   COLORBAR 在已经存在的IDL图形中增加一个colorbar或创建. 03   MAPGRID 在已经存在的IDL地图图 ...

  5. HBase学习

    记录HBase的学习过程.之后会陆续添加内容. 阅读hbase的博客,理解hbase是什么.推荐博文: 1,HBase原理,基础架构,基础概念 2,HBase超详细介绍 --------------- ...

  6. seajs的CMD模式的优势以及使用

    之前有一篇博客非常详细的介绍了sea.js的加载流程,以及源代码实现,链接地址:http://www.cnblogs.com/chaojidan/p/4123980.html 这篇博客我主要讲下sea ...

  7. awk的涂鸦

    awk太牛了,博大精深,学不透,学了不用,又忘. 所以花了一天,自己总结了基础,以后就当字典查(容易忘).有不对的地方,忘大家指出. [ganzl@cmdb ~]$ more /etc/passwd ...

  8. HTML5 canvas beginPath() 方法

    beginPath() 方法开始一条路径,或重置当前的路径.w3school上的解释! 路径是canvas里很重要的一个概念,刚开始学canvas的人对路径理解不是很深,他们在用canvas的时候会乱 ...

  9. Graded Browser Support

    ( The YUI Target Environments Matrix is here) About the Browser Test Baseline and Operating Systems ...

  10. [转]eclipse最佳设置

    设置工作空间的项目编码, 防止出现乱码     Window - Preferences - General - Workspace     将"Text file encoding&quo ...