脚踏实地、勇往直前!
全部博文(1005)
分类: Mysql/postgreSQL
2015-07-16 16:31:15
今天在官网上下载了一份编译好的mysql安装文件(mysql-5.6.25-win32.zip),这个解压后是没有exe安装文件的,平时
在windows下都习惯了直接运行安装文件,点击下一步的这样安装方式,下面跟大家演示下在没有安装文件的情况下如何
安装mysql.
1.解压缩zip文件并进入到bin目录,安装mysql服务
C:\Users\hxl>F:\learning\mysql\mysql-5.6.25-win32\bin\mysqld.exe install MySQL --defaults-file="F:\learning\mysql\mysql-5.6.25-win32\my.ini"
Service successfully installed.
我这里指定了启动的配置文件my.ini.
2.将mysql的bin目录加入到path环境变量
3.使用root用户登录到mysql
这里root用户初始是没有密码的
C:\Users\hxl>mysql -h localhost -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.25 MySQL Community Server (GPL)
Copyright (c) 2000, 2015, 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.
4.登录进入查看下目前的已经存在的用户
C:\Users\hxl>mysql -h localhost -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.25 MySQL Community Server (GPL)
Copyright (c) 2000, 2015, 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.
5.修改root用户的密码
SET SQL_SAFE_UPDATES = 0;
update mysql.user set password=password('mysql') where user='root';
flush privileges;
6.退出后重新登录
C:\Users\hxl>mysql -h localhost -uroot -pmysql
7.创建相应的用户
grant ALL on *.* to 'root'@'192.168.50.%' identified by 'mysql' WITH GRANT OPTION;
这样192.168.50网络段的机器就可以登陆了.
-- The End --