《Mysql学习mysql 5.7.11 winx64初始密码修改》要点:
本文介绍了Mysql学习mysql 5.7.11 winx64初始密码修改,希望对您有用。如果有疑问,可以联系我们。
MYSQL教程从官网下载MySQL-5.7.11-winx64压缩版,安装后发现竟然有密码,尝试无果,通过修改密码搞定
MYSQL教程安装成功后:
MYSQL教程关闭mysql服务在跟目录下修改文件my.ini,内容如下:注意两点 1:内容中myql的安装目录换成读者的安装目录;2最后一行代表登录是否需要密码,这里我们绕过密码登录进入mysql修改密码,所以不注释skip-grant-tables
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.
[client]
default-character-set=utf8
[mysqld]
port=3306
# D:\Program Files\mysql-5.7.11-winx64\mysql-5.7.11-winx64
basedir ="D:\Program Files\mysql-5.7.11-winx64\mysql-5.7.11-winx64/"
datadir ="D:\Program Files\mysql-5.7.11-winx64\mysql-5.7.11-winx64/data/"
tmpdir ="D:\Program Files\mysql-5.7.11-winx64\mysql-5.7.11-winx64/data/"
socket ="D:\Program Files\mysql-5.7.11-winx64\mysql-5.7.11-winx64/data/mysql.sock"
log-error="D:\Program Files\mysql-5.7.11-winx64\mysql-5.7.11-winx64/data/mysql_error.log"
#server_id = 2
#skip-locking
max_connections=100
table_open_cache=256
query_cache_size=1M
tmp_table_size=32M
thread_cache_size=8
innodb_data_home_dir="D:\Program Files\mysql-5.7.11-winx64\mysql-5.7.11-winx64/data/"
innodb_flush_log_at_trx_commit =1
innodb_log_buffer_size=128M
innodb_buffer_pool_size=128M
innodb_log_file_size=10M
innodb_thread_concurrency=16
innodb-autoextend-increment=1000
join_buffer_size = 128M
sort_buffer_size = 32M
read_rnd_buffer_size = 32M
max_allowed_packet = 32M
explicit_defaults_for_timestamp=true
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
skip-grant-tables
####################配置文件结束###################
MYSQL教程修改保存后,在cmd中,由于我们已经在path配置了环境变量,所以我们可以直接启动mysql
MYSQL教程
net start mysql
MYSQL教程启动成功后,登录mysql
MYSQL教程
mysql -u root -p
MYSQL教程密码为空 这里我们直接回车登录成功
登录成功后,我们修改数据库执行如下
MYSQL教程
use mysql
MYSQL教程
update user set authentication_string=password("123456") where user="root";
MYSQL教程这里注意最后必需加上分号
MYSQL教程成功后刷新
MYSQL教程
flush privileges;
MYSQL教程致此我们密码就修改成功了,退出关闭mysql服务,然后把my.ini中最后一行注释掉,从新启动mysql服务,发现新密码生效.
MYSQL教程以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持维易PHP.
转载请注明本页网址:
http://www.vephp.com/jiaocheng/6218.html