å®è£
MySQLmysql-5.6.14å¯ä»¥åèå¦ä¸å®è£
æ¥éª¤ï¼
1ãå°è§£å缩åçæ件æ¾å°èªå·±æ³è¦çå°æ¹ï¼å¹¶é
ç½®ç¯å¢åéã示ä¾ä¸åæ¾çç®å½ä¸ºï¼F:\mysql\mysql-5.6.14-winx64
2ãå¨ç¯å¢åéä¸æ·»å ï¼MYSQL_HOME:F:\mysql\mysql-5.6.14-winx64ï¼å¨pathè·¯å¾ä¸å å
¥ï¼%MYSQL_HOME%\binãé
ç½®ç¯å¢åéä¸æ¯å¿
é¡»çï¼åªæ¯ä¸ºäºè½æ´æ¹ä¾¿çå¨å½ä»¤è¡ä¸ä½¿ç¨mysqlçå½ä»¤è¡å·¥å
·ã
3ãä¿®æ¹inié
ç½®æ件
5.6.14ç解å缩çéæä¸ä¸ªmy-default.iniæ件ï¼copyä¸ä»½æ¹å为my.iniæ¾å¨å级ç®å½ä¸ãä¿®æ¹my.iniï¼ 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]
loose-default-character-set=utf8
basedir = F:/mysql/mysql-5.6.14-winx64
datadir = F:/mysql/mysql-5.6.14-winx64/data
[client]
loose-default-character-set=utf8
[WinMySQLadmin]
Server=F:/mysql/mysql-5.6.14-winx64/bin/mysqld.exe
# 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
# 设置mysqlçå®è£
ç®å½
# 设置mysqlæ°æ®åºçæ°æ®åæ¾ç®å½
# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = .....
character-set-server=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
4ãå®è£
æå¡
å¼å§ââææç¨åºââé件ââå½ä»¤æ示符ï¼å³é®ä»¥ç®¡çå身份è¿è¡ã è¾å
¥å½ä»¤ï¼
C:\>f:
F:\>cd F:\mysql\mysql-5.6.14-winx64\bin
F:\mysql\mysql-5.6.14-winx64\bin>mysqld -install
Service successfully installed.
5ãå¯å¨æå¡
F:\mysql\mysql-5.6.14-winx64\bin>cd\
F:\>net start mysql
MySQL æå¡æ£å¨å¯å¨ .
MySQL æå¡å·²ç»å¯å¨æåã
6ãé
ç½®ç¨æ·
è¿å¨ä¸é¢çå½ä»¤çªå£éé¢ï¼è¾å
¥å½ä»¤ï¼mysql -u root -p
å车åæ示è¾å
¥å¯ç ã
mysql解å缩çå次å®è£
管çårootçå¯ç 为空ï¼å æ¤ç´æ¥åå车ä¸æ¬¡å°±ç»å
¥mysqlæ°æ®åºäºã
F:\>mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.14 MySQL Community Server (GPL)
Copyright (c) 2000, 2013, 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.
æåå
è¾å
¥å½ä»¤ï¼use mysql;ãããããã/*使ç¨mysqlæ°æ®åº*/
mysql> use mysql
Database changed
è¾å
¥å½ä»¤ï¼select host,user,password from user;ãããã/* æ¥çç³»ç»çè´¦æ·ä¿¡æ¯ */
mysql> select host,user,password from user;
+-----------+------+----------+
| host | user | password |
+-----------+------+----------+
| localhost | root | |
| 127.0.0.1 | root | |
| ::1 | root | |
| localhost | | |
+-----------+------+----------+
4 rows in set (0.00 sec)
hostï¼ä»£è¡¨mysqlæå¡å
许åªä¸ªIPæ¥ç请æ±ãlocalhostå127.0.0.1æmysqlæå¡æå¨ç主æºï¼å³æ¬å°ãï¼ï¼1æ¯IPV6çIPå°ååæ³ï¼
å
¨ç§°ä¸ºï¼0000:0000:0000:0000:0000:0000:0000:0001ãç°å¨é½æ¯IPV4çç½ç»ï¼å¯ä»¥ä¸ç¨ç®¡ä»ã
userï¼æè´¦æ·å称ãä¸åçhostä¸è´¦æ·å称å¯ä»¥ç¸åã
passwordï¼å¯ç ã
å¯ä»¥çå°ï¼é»è®¤è´¦æ·éåªæ¯ææ¬å°è¿æ¥ï¼å¹¶ä¸è´¦æ·æ²¡æå¯ç ãç°å¨çé®é¢æç¡®äºï¼å°±æ¯è¦å°å¿åç¨æ·å é¤ï¼ä¸ºrootç¨æ·æ·»å è¿ç¨è®¿é®åå¯ç ï¼å为èªå·±æ·»å 个人账æ·ãæ令å¦ä¸ï¼
mysql> update user set password=PASSWORD('root') where user='root';
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3 Changed: 3 Warnings: 0
mysql> grant all on *.* to root@'%' identify by 'root';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'ident
ify by 'root'' at line 1
mysql> grant all on *.* to walle@'%' identify by '123456' with grant option;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'ident
ify by '123456' with grant option' at line 1
mysql> delete from where user='';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'where
user=''' at line 1
mysql> select host,user,password from user;
+-----------+------+-------------------------------------------+
| host | user | password |
+-----------+------+-------------------------------------------+
| localhost | root | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| 127.0.0.1 | root | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| ::1 | root | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| localhost | | |
+-----------+------+-------------------------------------------+
4 rows in set (0.00 sec)
mysql> commit;
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)