mysql 5.6.22 32位下载地址:http://cdn.mysql.com//archives/mysql-5.6/mysql-5.6.22-win32.zip
1 从http://dev.mysql.com/downloads/mysql/ 下载MySQL Community Server的Windows 平台mysql-5.6.14-win32.zip压缩包
2 将文件解压至F:\mysql-5.6.14-win32
3 切换至目录F:\mysql-5.6.14-win32,将文件my-default.ini复制一份重命名为my.ini放到当前目录下
4 打开my.ini进行MySQL配置,主要设置以下几项:
以下是我的my.ini配置:
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/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. [mysqld] # Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M # Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin # These are commonly set, remove the # and set as required.
basedir = D:\mysql5.7\mysql-5.6.22-win32\mysql-5.6.22-win32
datadir = D:\mysql5.7\mysql-5.6.22-win32\mysql-5.6.22-win32\data
port = 3306
# server_id = ..... bind-address = 127.0.0.1
character-set-server = utf8 default-storage-engine=INNODB
max_connections=100 [client]
default-character-set=utf8 # Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M #sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
5 将MySQL的F:\mysql-5.6.14-win32\bin目录加入系统环境变量
6 在CMD控制台将目录切换到F:\mysql-5.6.14-win32\bin,运行: mysqld -install 安装MySQL的服务,然后到服务列表中启动它
7 在CMD控制台下运行mysqladmin -uroot -p password 123456并回车,设置root用户新密码为123456。接下来输入密码的提示是指输入原密码,初始root密码为空
8 在CMD控制台下运行mysql -uroot -p,根据提示输入密码成功后就可以使用MySQL了
后面可能会报错:
C:\Users\ch
λ mysql -uroot -proot
Warning: Using a password on the command line interface can be insecure.
ERROR (): Access denied for user 'root'@'localhost' (using password: YES)
解决方法:
再执行一遍7:mysqladmin -uroot -p password 123456 即可。
C:\Users\ch
λ mysqladmin -uroot -p password
Enter password: ******
Warning: Using a password on the command line interface can be insecure.
熟悉的界面:
C:\Users\ch
λ mysqla -uroot -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.6. MySQL Community Server (GPL) Copyright (c) , , 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>
有可能会出现问题:
ERROR 1044 (42000): Access denied for user ''@'localhost' to database
mysql> CREATE DATABASE python;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'python'
解决方法:
请不要用默认游客登录,登录的时候请指定用户名和密码,即:不要用mysql登录,使用 mysql -uroot -p123456 登录
执行以下命令进入控制台:
mysql --user=root -p
输入root用户的密码即可进入mysql控制台:
http://blog.csdn.net/fengbingyang/article/details/17149769
http://www.tuicool.com/articles/Ubauuii
dd