安装成功后可测试如下:打开mysql command line client,输入密码,出现 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.1.33-community MySQL Community Server (GPL) Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> 则安装成功! 错误3:mysql server configuration失败。 在配置向导中查看错误提示有如下语句: mysql-server-5.5-win32:60 - Adding firewall rule for MySQL55 on port 3306. mysql-server-5.5-win32:66 - Adding firewall rule failed. 表示防火墙安装失败。 查看安装日志能找到以下语句: mysql-installer Information: 10 : Attempting to create firewall rule with command: netsh.exe firewall add portopening protocol=TCP port=3306 profile=ALL name=MySQL55 mode=ENABLE scope=ALL mysql-installer Information: 10 : Unexpected response from netsh: 确定。 mysql-installer Information: 10 : Attempting to create firewall rule with command: netsh.exe advfirewall firewall add rule name=”Port 3306” protocol=TCP localport=3306 dir=in action=allow mysql-installer Information: 10 : Unexpected response from netsh: 下列命令没有找到: advfirewall firewall add rule name=”Port 3306” protocol=TCP localport=3306 dir=in action=allow。 这种情况说明mysql的安装对中文系统支持得不好,不能识别 netsh.exe返回的“确定”信息,继而运行能在其他windows平台上运行的netsh.exe advfirewall命令(该命令xp不支持,所以报找不到该命令的错误。 解决办法有两个: ①将自己的操作系统的语言设置为英文,然后重新安装mysql 。具体的可以进入控制面板->区域和语言 中去更改;另外,检查当前用户是否有启动防火墙的权限,在计算机服务中查看Application Layer Gateway Service的属性,查看登录选项卡中的用户是否是当前用户。 ②检查防火墙端口,如果已经添加成功了,则不作处理,如果没有成功添加,则自己手动在防火墙中添加端口。 错误4:安装成功之后,只能通过mysql 5.5 command line client 连接localhost的mysql server,而不能通过workbench或其他客户端工具进行远程连接mysql server。 关键字:不能远程连接mysql server。 可能原因: ①没有开端口,参见前一条解决。 ②用户没有授权远程连接3306。 ③mysql server不允许远程连接。 对于②用户没有授权远程连接,可以给用户授权,例如默认的root用户,可以在mysql 5.5 command line client 中输入如下命令:
//选择数据库
mysql>use mysql;
//给用户授权,yourpassword字段用你的密码代替
mysql>grant all priileges on *.* to identified by 'yourpassword';
//刷新系统权限表
mysql>flush privileges;
//查看是否授权成功
mysql> show grants for roots;
如果出现刚刚的授权,则表示成功。不成功的话,自己再添加一个新用户试试,添加用户的命令:
insert into mysql.user(Host,User,Password,ssl_cipher,x509_issuer,x509_subject) values("%","newuser",password("newpassword"),'','','')