mysql安装
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了mysql安装,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3911字,纯文字阅读大概需要6分钟。
内容图文
![mysql安装](/upload/InfoBanner/zyjiaocheng/510/5a269eef33fa4eda98556adb0b94cf5d.jpg)
3.编写配置文件
我们发现解压后的目录并没有my.ini(或my-default.ini)文件,没关系可以自行创建。在安装根目录下添加 my.ini,比如我这里是:C:\Program Files\MySQL\MySQL Server 5.7\\my-default.ini,写入基本配置:
[mysqld]
# 设置3306端口
port=3306
# 设置mysql的安装目录
basedir=C:\Program Files\MySQL\MySQL Server 5.7\
# 设置mysql数据库的数据的存放目录
datadir=C:\Program Files\MySQL\MySQL Server 5.7\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
[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8
[client]
# 设置mysql客户端连接服务端时默认使用的端口
port=3306
default-character-set=utf8
4、MYSQL 执行安装
C:\Program Files\MySQL\MySQL Server 5.7\bin>mysqld install
Service successfully installed.
5、MYSQL初始化
C:\Program Files\MySQL\MySQL Server 5.7\bin>mysqld --initialize --console
2019-05-07T01:03:58.089955Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-05-07T01:03:59.425915Z 0 [Warning] InnoDB: New log files created, LSN=45790
2019-05-07T01:03:59.858905Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2019-05-07T01:04:00.012429Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: ff60d9a5-7063-11e9-93dc-7427eac27e63.
2019-05-07T01:04:00.067655Z 0 [Warning] Gtid table is not ready to be used. Table ‘mysql.gtid_executed‘ cannot be opened.
2019-05-07T01:04:00.232744Z 1 [Note] A temporary password is generated for root@localhost: g/)pkWZzM32N
C:\Program Files\MySQL\MySQL Server 5.7\bin>
6、MYSQL 启动服务
C:\Program Files\MySQL\MySQL Server 5.7\bin>net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。
7、修改初始化密码:
C:\Program Files\MySQL\MySQL Server 5.7\bin>mysql -u root -p
Enter password: ************
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.26
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 WITH mysql_native_password BY ‘root‘;
8、利用初始化密码登录
C:\Program Files\MySQL\MySQL Server 5.7\bin>mysql -u root -p
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.26 MySQL Community Server (GPL)
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>
修改Mysql 数据库默认密码方法二
用bin目录下的工具mysqladmin
格式:mysqladmin -u用户名 -p旧密码 password 新密码
例子:mysqladmin -uroot -p123456 password 123
工具连接本地的mysql数据库
mysql安装
标签:NPU ann tor man localhost 环境 mysql 数据库 ref 服务端
本文系统来源:https://www.cnblogs.com/druck/p/11123697.html
内容总结
以上是互联网集市为您收集整理的mysql安装全部内容,希望文章能够帮你解决mysql安装所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。