Mysql实例mysql安装详细指南
《Mysql实例mysql安装详细指南》要点: MYSQL学习2.安装MySQL,我安装在D:MySQLMySQL Server 5.7目录下 MYSQL学习3.将目录下的默认文件 my-default.ini 改名 为my.ini MYSQL学习4.打开my.ini,添加配置: MYSQL学习??? [WinMySQLAdmin] MYSQL学习??? [mysqld] MYSQL学习??? basedir = D:MySQLMySQL Server 5.7 MYSQL学习??? log_bin = mysql-bin MYSQL学习?????????? ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,PIPES_AS_CONCAT,ANSI_QUOTES MYSQL学习5.在D:MySQLMySQL Server 5.7目录下创建data文件夹用来存放数据 MYSQL学习6.我的电脑->属性->高级系统设置(高级)->环境变量,43); font-family: Arial; font-size: 14px;">MYSQL学习??? 添加MYSQL_HOME变量,值为D:MySQLMySQL Server 5.7 MYSQL学习??? 在Path变量中添加%MYSQL_HOME%bin用分号(;)隔开 MYSQL学习7.cmd进入到bin下输入初始化命令(管理员方式打开cmd): MYSQL学习??? D:MySQLMySQL Server 5.7bin>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. 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:MySQLMySQL Server 5.7data下产生了旧数据,将旧数据删掉. MYSQL学习8.cmd进入bin输入安装命令: MYSQL学习?????????? D:MySQLMySQL Server 5.7bin>mysqld --install MYSQL学习?? 表示安装成功 MYSQL学习9.cmd进入bin输入启动命令: MYSQL学习?????????? D:MySQLMySQL Server 5.7bin>net start MySQL MYSQL学习10.cmd进入bin输入进入mysql命令: MYSQL学习????????? ?D:MySQLMySQL Server 5.7bin>mysql -u root -p MYSQL学习?????????? Enter password:输入第7步产生的随机密码 MYSQL学习? ?????????? Welcome to the MySQL monitor.? Commands end with ; or g.?????????? Your MySQL connection id is 3 ?????????? Server version: 5.7.14-log ?????????? Copyright (c) 2000,2016,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学习? 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学习+--------------------+ MYSQL学习恭喜你至此你已经成功安装完MySQL! (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |