《Mysql实例mysql安装详细指南》要点:
本文介绍了Mysql实例mysql安装详细指南,希望对您有用。如果有疑问,可以联系我们。
MYSQL学习2.安装MySQL,我安装在D:\MySQL\MySQL Server 5.7目录下
MYSQL学习3.将目录下的默认文件 my-default.ini 改名 为my.ini
MYSQL学习4.打开my.ini,添加配置:
MYSQL学习 [WinMySQLAdmin]
Server=D:\MySQL\MySQL Server 5.7\bin\mysqld.exe
MYSQL学习 [mysqld]
MYSQL学习 basedir = D:\MySQL\MySQL Server 5.7
datadir = D:\MySQL\MySQL Server 5.7\data
port = 3306
server_id = 1
max_connections=1024
MYSQL学习 log_bin = mysql-bin
explicit_defaults_for_timestamp = TRUE
sql_mode=ONLY_FULL_GROUP_BY,NO_AUTO_VALUE_ON_ZERO,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,
MYSQL学习 ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,PIPES_AS_CONCAT,ANSI_QUOTES
MYSQL学习5.在D:\MySQL\MySQL Server 5.7目录下创建data文件夹用来存放数据
MYSQL学习6.我的电脑->属性->高级系统设置(高级)->环境变量,
MYSQL学习 添加MYSQL_HOME变量,值为D:\MySQL\MySQL Server 5.7
MYSQL学习 在Path变量中添加%MYSQL_HOME%\bin用分号(;)隔开
MYSQL学习7.cmd进入到bin下输入初始化命令(管理员方式打开cmd):
MYSQL学习 D:\MySQL\MySQL Server 5.7\bin>mysqld --initialize --user=mysql --console
MYSQL学习 2016-08-07T02:57:11.678911Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2016-08-07T02:57:11.678911Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
2016-08-07T02:57:16.351247Z 0 [Warning] InnoDB: New log files created, LSN=45790
2016-08-07T02:57:17.335589Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2016-08-07T02:57:18.054363Z 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: a700687c-5c4a-11e6-830e-e89a8ffd15e0.
2016-08-07T02:57:18.132545Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2016-08-07T02:57:18.210786Z 1 [Note] A temporary password is generated for root@localhost: dei05oKloX)k
MYSQL学习 此时产生一个随机密码请记住:dei05oKloX)k
MYSQL学习 如果出现如下告警,:
MYSQL学习 2016-08-07T02:19:28.889373Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
MYSQL学习 检查你的my.ini 中explicit_defaults_for_timestamp = TRUE是否配置正确
MYSQL学习 2016-08-07T02:19:28.904984Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
MYSQL学习 这是前面安装失败导致D:\MySQL\MySQL Server 5.7\data下产生了旧数据,将旧数据删掉.
MYSQL学习8.cmd进入bin输入安装命令:
MYSQL学习 D:\MySQL\MySQL Server 5.7\bin>mysqld --install
Service successfully installed.
MYSQL学习 表示安装成功
MYSQL学习9.cmd进入bin输入启动命令:
MYSQL学习 D:\MySQL\MySQL Server 5.7\bin>net start MySQL
MySQL 服务正在启动 ..
MySQL 服务已经启动成功.
MYSQL学习10.cmd进入bin输入进入mysql命令:
MYSQL学习 D:\MySQL\MySQL Server 5.7\bin>mysql -u root -p
MYSQL学习 Enter password:输入第7步产生的随机密码
MYSQL学习
MYSQL学习
MYSQL学习 出现mysql>表示成功进入到了mysql
MYSQL学习11.对初始的随机密码进行修改
MYSQL学习 mysql>set password for root@localhost = password('root');
MYSQL学习 Query OK, 0 rows affected, 1 warning (0.25 sec)
MYSQL学习 将root用户的初始随机密码修改为root(自己设定的密码)
MYSQL学习12.查看数据库mysq>show databases;
MYSQL学习+--------------------+
| Database |
+--------------------+
| information_schema |
| myoneweb |
| mysql |
| performance_schema |
| sys |
+--------------------+
MYSQL学习恭喜你至此你已经成功安装完MySQL!
转载请注明本页网址:
http://www.vephp.com/jiaocheng/5788.html