xampp

Xampp

今天学习了xampp。就来简单讲解一下我今天遇到的问题吧

1、首先是下载xampp。官网是:xampp官网

2、安装警告:

1
"Important! Because an activated User Account Control (UAC) on your system some functions of XAMPP are possibly restricted. With UAC please avoid to install XAMPP to C:\Program Files(Missing Write permissions). Or Deactivate UAC with msconfig after this setup."

这个是可以忽略的。

3、直接下一步,想修改安装路径的话就记得修改。

4、接下来就是下载wordpress的压缩包:WordPress官网

下载安装包,解压后,把解压后的文件放到xampp/htdocs的文件夹下。

5、在开启MYSQL的时候,报了一个错:

1
2
3
Problem detected!
Port3306 in use by ""D:\MySQL\bin\mysqld" --defaults- files=""D:\Program Files (x86)\MySQL\my.ini" MySQL"
...

解决办法是:打开注册器,找到MySQL,并修改ImagePath改成

1
"D:\xampp\mysql\bin\mysqld" --defaults-file="C:\Program Files\MySQL\MySQL Server 8.0\my.ini" MySQL

6、在我想打开phpMyAdmin的时候:(xampp界面下的MYSQL后面的Admin),访问被拒绝:解决方法是:

1
去phpmyadmin文件夹中的config.inc.php文件中修改对应的mysql密码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
/*
* This is needed for cookie based authentication to encrypt password in
* cookie
*/
$cfg['blowfish_secret'] = 'xampp'; /* YOU SHOULD CHANGE THIS FOR A MORE SECURE COOKIE AUTH! */
/*
* Servers configuration
*/
$i = 0;
/*
* First server
*/
$i++;
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
/*下面这句的root是你的数据库的用户名*/
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '改成你的数据库密码';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';
/* Bind to the localhost ipv4 address and tcp */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = '';
/* Advanced phpMyAdmin features */
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
$cfg['Servers'][$i]['relation'] = 'pma__relation';
$cfg['Servers'][$i]['table_info'] = 'pma__table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma__column_info';
$cfg['Servers'][$i]['history'] = 'pma__history';
$cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords';
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
$cfg['Servers'][$i]['recent'] = 'pma__recent';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
$cfg['Servers'][$i]['users'] = 'pma__users';
$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
$cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
$cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
$cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
$cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
$cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
$cfg['Servers'][$i]['favorite'] = 'pma__favorite';
/*
* End of servers configuration
*/
?>

7、在创建数据库连接时,报错:

1
2
3
4
5
6
7
Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at localhost. This could mean your host’s database server is down.
Are you sure you have the correct username and password?
Are you sure that you have typed the correct hostname?
Are you sure that the database server is running?
If you’re unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.

解决办法是:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
找到下面这些:
代码如下
/** WordPress数据库的名称,替换掉 “putyourdbnamehere” */
define('DB_NAME', 'wordpress');
/** MySQL数据库用户名,替换掉 “usernamehere” */
define('DB_USER', 'root');
/** MySQL数据库密码,替换掉 “yourpasswordhere” */
define('DB_PASSWORD', 'root');
/** MySQL主机名 */
define('DB_HOST', 'localhost');
DB_NAME为WordPress数据库的名称
DB_USER为MySQL数据库用户名
DB_PASSWORD为MySQL数据库密码
DB_HOST为MySQL主机名,一般默认localhost不用修改,特殊的可以修改成 localhost:3306/wordpress 这种形式
但还是解决不了于是就有了下面的解决过程,WORDPRESS出现这种情况的原因可能是:
1、无法连接到Wordpress使用的数据库。
你的wp-config.php中的数据库用户名和密码错误,或者你的数据库所在服务器挂掉了!也有可能是服务商短时间内限制(访问量突然暴涨的博客或使用一些消耗数据库连接的WP插件)
解决办法是,确认wp-config.php中的用户名和密码信息正确。确认WP使用的数据库服务器没有挂掉(可以ping或直接重启?!)。确认数据库连接方式,是远程连接还是本地连接,有些配置的远程连接的可能出现连不上数据库的情况,也就会出现这个“Error establishing a database connection”提示,一般虚拟空间(GD的空间使用的远程数据库连接)或合租空间都是使用的本地连接(localhost)。
###但是wp-config.php并没有创建成功!(第一次使用)
所有MYSQL在输入数据库名称、用户名、密码、主机名和Table Prefix,点击提交就会报错。说是连接数据库出错!因为端口已经被占用了!
那么久从根本入手: 点击MySQL的config配置一下:在下面这里
1
2
3
4
5
6
# The MySQL server
#加上下面的这两句
[mysqld]
innodb_force_recovery = 4
port= 3306

但是当我把这句话 innodb_force_recovery = 4 加上之后,又报了新的错:

1
2
我的数据库不支持innodb,也就是还不支持innodb_force_recovery = 4 。
我就把这句话删掉了。之后mysql又运行成功了!!!!!

8、之后我再打开又被拒绝了。

解决方法是:找到phpmyadmin的配置文件,好像是 config.inc.php 文件,找到下面行:

$cfg[‘Servers’][$i][‘user’] = ‘root’;

$cfg[‘Servers’][$i][‘password’] = ‘root’;

将password 项改为空,重启下服务器。

总结:

1
我今天从一开始,就不应该因为改了注册表中数据库的ImagePath,就去乱改它的密码,把它设为我的数据库的密码。没有想到的是wordpress下载来就没有密码。

在2018年6月28日我打开xampp的时候发现我的数据库又不能用了,报如下的错误:

1
2
3
4
5
6
7
Error: MySQL shutdown unexpectedly.
10:12:22 [mysql] This may be due to a blocked port, missing dependencies,
10:12:22 [mysql] improper privileges, a crash, or a shutdown by another method.
10:12:22 [mysql] Press the Logs button to view error logs and check
10:12:22 [mysql] the Windows Event Viewer for more clues
10:12:22 [mysql] If you need more help, copy and post this
10:12:22 [mysql] entire log window on the forums

从字面上的意思是端口的错误,但是我把端口改了,也还是没有好啊:按照下面这个改的:

改端口来解决,但是没有解决

我重新百度找了一个:修改innob的

但是又报了错误啊:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2018-06-28 10:31:04 2452 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2018-06-28 10:31:04 2452 [Note] InnoDB: The InnoDB memory heap is disabled
2018-06-28 10:31:04 2452 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2018-06-28 10:31:04 2452 [Note] InnoDB: Memory barrier is not used
2018-06-28 10:31:04 2452 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-06-28 10:31:04 2452 [Note] InnoDB: Not using CPU crc32 instructions
2018-06-28 10:31:04 2452 [Note] InnoDB: Initializing buffer pool, size = 16.0M
2018-06-28 10:31:04 2452 [Note] InnoDB: Completed initialization of buffer pool
2018-06-28 10:31:04 2452 [ERROR] InnoDB: D:\xampp\mysql\data\ibdata1 can't be opened in read-write mode
2018-06-28 10:31:04 2452 [ERROR] InnoDB: The system tablespace must be writable!
2018-06-28 10:31:04 2452 [ERROR] Plugin 'InnoDB' init function returned error.
2018-06-28 10:31:04 2452 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2018-06-28 10:31:04 2452 [Note] Plugin 'FEEDBACK' is disabled.
2018-06-28 10:31:04 2452 [ERROR] Unknown/unsupported storage engine: InnoDB
2018-06-28 10:31:04 2452 [ERROR] Aborting

接下来解决这样做的:

1
http://www.mamicode.com/info-detail-1444806.html

可是问题还是没有解决啊。

解决服务问题,但是试了没有反应,还是无法启动数据库