wamp中的mysql服务与原来安装的mysql服务冲突的解决办法

by admin on 2019年11月1日

第一次安装wamp之后,所有服务可以正常使用,但是重启之后wamp的图标就变成黄色的了,重装了也这样
图片 1

MySQL无法启动的解决办法,mysql启动解决办法

MySQL无法启动的解决办法

MySQL无法启动

在停止mysql之后,执行了一些操作(如修改主机名),重新启动
mysql,发现起不来。 

[[email protected] ~]$ service mysql start 
Starting MySQL..^[[A.................................................................................................. ERROR! The server quit without updating PID file (/disk/mysql/www.pid).
[[email protected] ~]$ service mysql stop 
 ERROR! MySQL server PID file could not be found!
[[email protected] ~]$ service mysql stop 
 ERROR! MySQL server PID file could not be found!
[[email protected] ~]$ service mysql start 
Starting MySQL..................
还是老样子,只好 Ctr+C 掉。
[[email protected] ~]$

实在是启动不了,看一下日志:/disk/mysql/www.err 

120608 09:56:17 mysqld_safe Starting mysqld daemon with databases from /disk/mysql
120608 9:56:17 [Note] Plugin 'FEDERATED' is disabled.
120608 9:56:17 InnoDB: The InnoDB memory heap is disabled
120608 9:56:17 InnoDB: Mutexes and rw_locks use InnoDB's own implementation
120608 9:56:17 InnoDB: Compressed tables use zlib 1.2.3
120608 9:56:17 InnoDB: Using Linux native AIO
120608 9:56:17 InnoDB: Initializing buffer pool, size = 128.0M
120608 9:56:17 InnoDB: Completed initialization of buffer pool
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
120608 9:56:17 InnoDB: Retrying to lock the first data file
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
...

 好像是原来的 mysqld 并没有停下来。

强制终止 mysqld

[[email protected] ~]$ ps -ef|grep mysql 
root   4769   1 0 Jun06 ?    00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/disk/mysql --pid-file=/disk/mysql/localhost.pid
mysql   4874 4769 0 Jun06 ?    00:04:04 /usr/sbin/mysqld --basedir=/usr --datadir=/disk/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --log-error=/disk/mysql/localhost.err --pid-file=/disk/mysql/localhost.pid --socket=/disk/mysql/mysql.sock
root   17947   1 0 09:56 pts/1  00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/disk/mysql --pid-file=/disk/mysql/www.pid
mysql  18052 17947 0 09:56 pts/1  00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/disk/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --log-error=/disk/mysql/www.err --pid-file=/disk/mysql/www.pid --socket=/disk/mysql/mysql.sock
root   18099 17514 0 09:56 pts/1  00:00:00 grep mysql
[[email protected] ~]$ killall mysqld 
[[email protected] ~]$ killall mysqld 
[[email protected] ~]$ ps -ef|grep mysql 
root   18116 17514 0 09:57 pts/1  00:00:00 grep mysql
[[email protected] ~]$

 启动 mysqld ,现在执行多次启动命令都没有问题。

[[email protected] ~]$ service mysql start 
Starting MySQL. SUCCESS! 
[[email protected] ~]$ 
[[email protected] ~]$ 
[[email protected] ~]$ 
[[email protected] ~]$ 
[[email protected] ~]$ service mysql start 
Starting MySQL SUCCESS! 
[[email protected] ~]$

前面 www.err 文件中显示的 error: 11 到底是什么,看下:

[[email protected] ~]$ perror 11 
OS error code 11: Resource temporarily unavailable
[[email protected] ~]$ 
[[email protected] ~]$

 如有疑问请留言或者到本站社区交流讨论,感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!

MySQL无法启动的解决办法 MySQL无法启动
在停止mysql之后,执行了一些操作(如修改主机名),重…

如果原来机器上已经安装了mysql,在安装wamp之后,打开wamp上的mysql时会打不开,或者会将原来安装的mysql服务关闭。原因是两个mysql共用了3306端口,解决办法是更改其中的一个端口即可。

在my.ini(linux下/etc/my.cnf)加上skip-innodb,就可以了。
我这样设置后,在linux下都没问题,今天在我本机winXP启动MYSQL,提示启动不起来。看下mysql目录的错误日志:
引用

查看一下错误日志:
图片 2

我修改了wamp中的端口为8806,以下是具体操作方法:

出现如下语句:The ‘InnoDB’ feature is disabled; you need MySQL built
with ‘InnoDB’ to have it working;

日志显示的错误是这样的:
图片 3

首先打开C:\wamp64\bin\mysql\mysql5.7.14\my.ini文件,找到

是mysql教程配置文件禁掉了这个选项!
关闭mysql数据库教程
在mysql的安装目录中找到my.ini文件
找到skip-innodb,在前面加上#号
保存,开启mysql数据库!搞定!
这也是开启Mysql数据库InnoDB功能的方法!!

日志提示可能是3306端口被占用的错误,那来看一下是哪个程序占用了3306端口:
windows下运行cmd ,输入

[client]

启动不解决方法

netstat -aon|findstr "3306"

;password = your_password
port = 8806        (修改此处)
socket = /tmp/mysql.sock

090613 10:15:27 [ERROR] Default storage engine (InnoDB) is not
available
090613 10:15:27 [ERROR] Aborting

图片 4
可以看到是pid为2092这个程序占用了3306端口,把他结束掉

 

090613 10:15:27 [Note] C:wwwmysqlbinmysqld-nt: Shutdown complete

输入指令:

[wampmysqld64]
;skip-grant-tables
port = 8806  (修改此处)
socket = /tmp/mysql.sock
key_buffer_size = 64M
max_allowed_packet = 16M

估计是上次加了参数后,一直没启动起来。已经很久没用本机的MySQL了。
查了下,原来my.ini里有一句:default-storage-engine=INNODB,把默认的engine设为INNODB,而我又加了skip-innodb,怪不得启不来了。

taskkill /f /pid 2092

 

将default-storage-engine改为MYISAM,MYSQL启动OK!
在skip-innodb下,data目录下的ibdata1,ib_logfile0,ib_logfile1这三个文件就不需要了,就可以删除。

图片 5

以及最后一行中的
[mysqlhotcopy]
interactive-timeout

测试了下,在没加skip-innodb时,删除了这三个文件,启动时会自动创建这三个文件,日志如下:
引用
InnoDB: The first specified data file .ibdata1 did not exist:
InnoDB: a new database to be created!
090613 10:19:37 InnoDB: Setting file .ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait…
090613 10:19:37 InnoDB: Log file .ib_logfile0 did not exist: new to be
created
InnoDB: Setting log file .ib_logfile0 size to 24 MB
InnoDB: Database physically writes the file full: wait…
090613 10:19:38 InnoDB: Log file .ib_logfile1 did not exist: new to be
created
InnoDB: Setting log file .ib_logfile1 size to 24 MB
InnoDB: Database physically writes the file full: wait…
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
090613 10:19:39 InnoDB: Started; log sequence number 0 0
090613 10:19:39 [Note] C:wwwmysqlbinmysqld-nt: ready for connections.

成功之后重启wamp,正常启动!
但是这种办法指标不治本,想要根治可以把mysql的端口更改一下。

[mysqld]
port = 8806(修改此处)

再删除这三个文件,加了skip-innodb后,启动日志:
引用

 

090613 10:30:12 [Note] C:wwwmysqlbinmysqld-nt: Normal shutdown

之后打开C:\wamp64\apps\phpmyadmin4.6.4\config.inc.php文件内容

090613 10:30:12 [Note] C:wwwmysqlbinmysqld-nt: Shutdown complete

$cfg[‘Servers’][$i][‘verbose’] = ‘Local Databases’;
$cfg[‘Servers’][$i][‘host’] = ‘127.0.0.1’;
$cfg[‘Servers’][$i][‘port’] = ‘8806’;(修改此处)
$cfg[‘Servers’][$i][‘extension’] = ‘mysqli’;
$cfg[‘Servers’][$i][‘auth_type’] = ‘cookie’;
$cfg[‘Servers’][$i][‘user’] = ‘你的用户名’;
$cfg[‘Servers’][$i][‘password’] = ‘你的密码’;

090613 10:30:17 [Note] C:wwwmysqlbinmysqld-nt: ready for
connections.
Version: ‘5.0.45’ socket: ” port: 3306 Source distribution

 

我这样设置后,在linux下都没问题,今天在我本机winXP启动MYSQL,提示启动不起来。看下m…

保存即可。

 

之后本地自己的原先装的mysql可用3306端口,wamp中的mysql可用8806端口。我的是这样使用的,原先安装的建了一个数据库,wamp的建立了一个数据库。

图片 6

 

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图