码迷,mamicode.com
首页 > 数据库 > 详细

目前安装并启动mysql遇到的问题:

时间:2015-11-23 16:14:20      阅读:141      评论:0      收藏:0      [点我收藏+]

标签:

第一个问题:

root@b-ThinkPad-X230s:/usr/local/mysql/bin# ./mysqld_safe start   (开启mysql的服务!)
151123 14:19:04 mysqld_safe Logging to ‘/usr/local/mysql/data/b-ThinkPad-X230s.err‘.
151123 14:19:04 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
151123 14:19:05 mysqld_safe mysqld from pid file /usr/local/mysql/data/b-ThinkPad-X230s.pid ended


root@b-ThinkPad-X230s:/usr/local/mysql/bin# ./mysql --user=mysql   (使用mysql用户登录)
ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘ (2)  (报错!)

以为是用户的问题,然后尝试换一个用户名:


root@b-ThinkPad-X230s:/usr/local/mysql/bin# ./mysql -u root         (使用root用户登录)
ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘ (2)  (报错!)

然后想着是否是没有用户设置密码的问题,因为貌似是不用密码也可以登录的,先尝试设置密码:

root@b-ThinkPad-X230s:/usr/local/mysql/bin# ./mysqladmin -u mysql password "123456"
./mysqladmin: connect to server at ‘localhost‘ failed
error: ‘Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘ (2)‘
Check that mysqld is running and that the socket: ‘/tmp/mysql.sock‘ exists!

查看服务是否已经启动:

root@b-ThinkPad-X230s:/tmp# ps -aux | grep "mysql"
root      4518  0.0  0.0  13708  2296 pts/11   S+   14:35   0:00 grep --color=auto mysql

 

目前安装并启动mysql遇到的问题:

标签:

原文地址:http://www.cnblogs.com/persistcat/p/4988436.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!