win7 mysql 启动 问题

>net start mysql

1 mysql服务无法启动 系统错误 1067

解决方法:

1 可能是my.ini 的配置问题

2 可能mysql 的 默认端口被占用:

C:Usersustc>netstat -aon|findstr "3306"
  TCP    0.0.0.0:3306           0.0.0.0:0              LISTENING       3176
  TCP    [::]:3306              [::]:0                 LISTENING       3176

查看占用了端口 3306 的进程。

tasklist|findstr "3176"

杀死进程

taskkill /f /pid 3176

再重新启动 mysql。

2 . net start mysql 时 服务名无效的问题

mysql服务没有安装。

解决办法: 在 mysql bin目录下 以管理员的权限 执行 mysqld -install命令

然后仍然以管理员的权限 net start mysql 开启Mysql服务了。

附卸载mysql服务的方法。

1、以管理员的权限 net stop mysql ,关闭mysql服务

2、以管理员的权限 mysqld -remove ,卸载mysql服务

3 . 已存在的库,但是show databases; 没有显示出来 

网上有解释:http://storysky.blog.51cto.com/628458/504406/

说my.ini中

mysql手册,里面是这样解释skip-show-database的

  With this option, the SHOW DATABASES statement is permitted only to users who have the SHOW DATABASES privilege, and the statement displays all database names. Without this option, SHOW DATABASES is permitted to all users, but displays each database name only if the user has the SHOW DATABASES privilege or some privilege for the database. Note that anyglobal privilege is considered a privilege for the database.

,原来如果不加这个选项所有的用户都可以 show databases的,只不过看到的只有自己有权限的库而已。如果 Show_db_priv: Y 的话估计就表示这个用户对所有数据库都有show databases权限了。

所以 我原本启动mysql后,mysql 进入,show databases; 没有显示 我原来创建的数据库,

但是当我mysql –u root 进入,就显示全部的了。

(另外,对我说...数据库目录都在F盘,以后别乱找了)

原文地址:https://www.cnblogs.com/xaf-dfg/p/4184763.html