xampp服务器搭建和使用

1.安装完XAMPP后会出现Apache端口被占用的问题,一下方法解决php

  1. 错误信息以下:html

    Error: Apache shutdown unexpectedly.mysql

    9:37:01  [Apache] This may be due to a blocked port, missing dependencies, sql

    9:37:01  [Apache] improper privileges, a crash, or a shutdown by another method.数据库

    9:37:01  [Apache] Press the Logs button to view error logs and checkpost

    9:37:01  [Apache] the Windows Event Viewer for more cluesui

    9:37:01  [Apache] If you need more help, copy and post thisthis

    9:37:01  [Apache] entire log window on the forumsspa

    xampp启动出错:This may be due to a blocked
  2. 2

    应该是端口的问题,这里使用程序提供的设置功能设置一下端口,具体须要点击程序界面上的【config】按钮。.net

    xampp启动出错:This may be due to a blocked
  3. 3

    在新窗口中点击【server and por setting】,在设置窗口上输入对应的对应的端口,须要记得一般状况下80窗口及443窗口能够一块儿修改。

    xampp启动出错:This may be due to a blocked
    xampp启动出错:This may be due to a blocked
  4. 4

    回到后,再次点击启动,仍是出错。。。。会不会是没有被修改,只能看一下程序下的配置文件,点xampp后的config,须要注意的是80端口及443端口须要分别设置。

    xampp启动出错:This may be due to a blocked
    xampp启动出错:This may be due to a blocked
  5. 5

    打开配置文件后,直接使用搜索功能找到80端口的配置,将端口修改成801之类的,443端口一样,须要修改成其它端口,保存文件。

    xampp启动出错:This may be due to a blocked
  6. 6

    配置好后,点击启动,能够正常了。这里须要注意的事情是,第一次配置用的端口要与第二次手动配置的保持一致,由于点击界面上的【admin】启动管理界面时,使用的是第一次配置时使用的端口,只有保持一致才能打开网页管理界面。

    xampp启动出错:This may be due to a blocked
    xampp启动出错:This may be due to a blocked
     
     
     
    数据库密码块

    若是想把密码改为别的,能够直接执行西面的SQL 语句,把new_password改为本身的密码便可:

    1
    UPDATE user SET password=PASSWORD( 'new_password' ) WHERE user= 'root' ;

    另外既然mysql的root用户密码已经修改了,那么phpmyadmin中的对应密码配置也要修改,找到配置文件,如个人是

    F: mppphpMyAdminconfig.inc.php

    找到以下代码

     代码以下 复制代码

     Authentication type and info */$cfg['Servers'][$i]['auth_type']
     = 'config';$cfg['Servers'][$i]['user']
     = 'root';$cfg['Servers'][$i]['password']
     = '';$cfg['Servers'][$i]['extension']
     = 'mysql';$cfg['Servers'][$i]['AllowNoPassword']
     = true;

    修改成

     代码以下 复制代码


     Authentication type and info */$cfg['Servers'][$i]['auth_type']
     = 'config';$cfg['Servers'][$i]['user']
     = 'root';$cfg['Servers'][$i]['password']
     = '123456';$cfg['Servers'][$i]['extension']
     = 'mysql';$cfg['Servers'][$i]['AllowNoPassword']
     = true;

    这样就会须要重启登陆phpmyadmin了。

     

    忘记密码怎么办

    1. 关闭正在运行的MySQL服务
    2. 打开DOS窗口,转到mysql\bin目录
    3. 输入mysqld --skip-grant-tables 回车       --skip-grant-tables 的意思是启动MySQL服务的时候跳过权限表认证
    4. 再开一个DOS窗口(由于刚才那个DOS窗口已经不能动了),转到mysql\bin目录 
    5. 输入mysql回车,若是成功,将出现MySQL提示符 >
    6. 链接权限数据库: use mysql;
    6. 改密码:update user set password=password("root") where user="root"; 
       mysql5.7以上版本-->    UPDATE user SET authentication_string=PASSWORD("root") WHERE User="root";
    7. 刷新权限(必须步骤):flush privileges; 
    8. 退出 quit。 
    9. 注销系统,再进入,使用用户名root和刚才设置的新密码123登陆。

相关文章
相关标签/搜索