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

mysql 启动失败

时间:2018-12-17 14:26:31      阅读:199      评论:0      收藏:0      [点我收藏+]

标签:sele   where   --   账户   ready   lte   进一步   upd   out   

一、报错信息如下:

MySQL启动报错“Bind on TCP/IP port: Address already in use”

分析原因:端口3306 被占用

ps -aux | grep mysql

发现3306 并没有被使用

使用命令:

netstat -apn|grep 3306

 

# netstat -apn | grep 3306
tcp 0 0 ::ffff:192.168.65.211:3306 ::ffff:192.168.65.211:3306 ESTABLISHED 18148/java

 

发现3306端口被PID为18148的Java进程占用。

进一步使用命令:ps -aux | grep java,或者直接:ps -aux | grep pid 查看
就可以明确知道3306端口是被哪个程序占用了!然后判断是否使用KILL命令干掉!

 

启动mysql ,服务正常

 

二、mysql登录:使用密码无法登录,不使用密码可以登录

 

select * from mysql.user where user=‘‘;


+-----------+------+----------+-------------+-------------+-------------+-------------+----------------+-----------+------------+-----------------+------------+------------+--------------+----------------+-----------------+------------------+------------------+----------------+--------------------+--------------+----------+------------+-------------+--------------+---------------+-----
| Host | User | Password | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_pr_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Show_db_priv | Supercute_priv | Repl_slave_priv | Repl_client_priv | Create_view_priv | Show_view_priv | Create_routit_priv | Trigger_priv | ssl_type | ssl_cipher | x509_issuer | x509_subject | max_questions | max_
+-----------+------+----------+-------------+-------------+-------------+-------------+----------------+-----------+------------+-----------------+------------+------------+--------------+----------------+-----------------+------------------+------------------+----------------+--------------------+--------------+----------+------------+-------------+--------------+---------------+-----
| localhost | | | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | | | | | 0 |
| hadoop01 | | | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | | | | | 0 |
+-----------+------+----------+-------------+-------------+-------------+-------------+----------------+-----------+------------+-----------------+------------+------------+--------------+----------------+-----------------+------------------+------------------+----------------+--------------------+--------------+----------+------------+-------------+--------------+---------------+-----
2 、rows in set (0.00 sec)
---------------------
查询有结果,然后进行下一步。
use mysql;
delete from user where user = ‘‘;

3、删除了多余的空白账户, 然后进行下一步。
flush privileges;-

4、重载一次权限表,最后用
service mysqld restart

5、重启mysql服务,问题得到解决

 

mysql 启动失败

标签:sele   where   --   账户   ready   lte   进一步   upd   out   

原文地址:https://www.cnblogs.com/yaxuan/p/10130457.html

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