mysql-5.6.21-winx64.zip的安装
1.安装windows服务(Windows7 用户必须以管理员启动cmd):
mysqld.exe -install MySQL --defaults-file=D:\tools\mysql-5.6.21-winx64\my.ini
注意:
mysqld.exe -install 的时候,如果不带defaults-file 默认会先找my.cnf,再找my.ini
2.start up
net start MySQL
有不可识别的参数会启动会报错:#MySQL5.6 配置文件 my.ini 1067错误
此时可从HOSTNAME.err文件中查看
3.登录修改密码
mysql -u root -p
mysql> update user set password = PASSWORD('root') where user='root';
mysql> flush privileges;
用 mysql 直接打回车登录 看不到 叫"mysql"库,因为不是root用户
mysql> select current_user
+--------------+
| current_user |
+--------------+
| @localhost |
+--------------+
1 row in set (0.00 sec)
mysql> select user();
+----------------+
| user() |
+----------------+
| ODBC@localhost |
+----------------+
1 row in set (0.00 sec)
4.my.ini 配置
最少配置:
[mysqld]
basedir = D:/tools/mysql-5.6.21-winx64
datadir = D:/tools/mysql-5.6.21-winx64/data
以下是我的配置
# The MySQL server
[mysqld]
server_id = 10
port = 3306
socket = mysql.sock
basedir = D:/tools/mysql-5.6.21-winx64
datadir = D:/tools/mysql-5.6.21-winx64/data
#
skip-external-locking
lower_case_table_names = 1
default-storage-engine = InnoDB
character-set-server = utf8
init_connect='SET NAMES utf8'
key_buffer_size = 8M
max_allowed_packet = 1M
table_open_cache= 64
sort_buffer_size=512K
net_buffer_length = 8K
# log_bin
sync_binlog = 1
#innodb_support_xa =0
slow-query-log = TRUE
slow-query-log-file = D:/tools/mysql-5.6.21-winx64/data/mysql-slow.log
1.安装windows服务(Windows7 用户必须以管理员启动cmd):
mysqld.exe -install MySQL --defaults-file=D:\tools\mysql-5.6.21-winx64\my.ini
注意:
mysqld.exe -install 的时候,如果不带defaults-file 默认会先找my.cnf,再找my.ini
2.start up
net start MySQL
有不可识别的参数会启动会报错:#MySQL5.6 配置文件 my.ini 1067错误
此时可从HOSTNAME.err文件中查看
3.登录修改密码
mysql -u root -p
mysql> update user set password = PASSWORD('root') where user='root';
mysql> flush privileges;
用 mysql 直接打回车登录 看不到 叫"mysql"库,因为不是root用户
mysql> select current_user
+--------------+
| current_user |
+--------------+
| @localhost |
+--------------+
1 row in set (0.00 sec)
mysql> select user();
+----------------+
| user() |
+----------------+
| ODBC@localhost |
+----------------+
1 row in set (0.00 sec)
4.my.ini 配置
最少配置:
[mysqld]
basedir = D:/tools/mysql-5.6.21-winx64
datadir = D:/tools/mysql-5.6.21-winx64/data
以下是我的配置
# The MySQL server
[mysqld]
server_id = 10
port = 3306
socket = mysql.sock
basedir = D:/tools/mysql-5.6.21-winx64
datadir = D:/tools/mysql-5.6.21-winx64/data
#
skip-external-locking
lower_case_table_names = 1
default-storage-engine = InnoDB
character-set-server = utf8
init_connect='SET NAMES utf8'
key_buffer_size = 8M
max_allowed_packet = 1M
table_open_cache= 64
sort_buffer_size=512K
net_buffer_length = 8K
# log_bin
sync_binlog = 1
#innodb_support_xa =0
slow-query-log = TRUE
slow-query-log-file = D:/tools/mysql-5.6.21-winx64/data/mysql-slow.log
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/807718/viewspace-2127634/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/807718/viewspace-2127634/