解决mysql登录报错:ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)
今天在个人电脑上安装VMware,并在VMware上安装了ubuntu,并且自动安装了MySQL Server.启动ubuntu并登录后,MySQL自动启动。
用secureCRT登录到ubuntu系统后,通过下面命令创建一个新用户luomiou
$mysql -uroot -p121212
mysql>use mysql;
mysql>grant all privileges on *.* to 'luomiou'@'%' identified by '121212';
但是我从vista上的SQLyog企业版登录,报标题的那个错误“错误码:2003 不能连接到 MySQL 服务器在 (10061)”,于是我在网上搜索,发现碰到这个问题的人还不少,但尝试了好些人给的办法,都没有办法解决。只好去看看MySQL的配制文件了,结果找到了/etc/mysql/my.cnf这个文件,幸好我的英文还没有全部还给老师,基本看懂了里边配置的意思,发现里边有一个配置:
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
这里的意思就是默认