简体   繁体   English

尝试连接到本地主机phpmyadmin时出现错误

[英]I am getting error while trying to connect to localhost phpmyadmin

I am new to the php server side and with mysql.With having some basic knowledge about that all.Recently install wamp server and some php file and database creation im trying to connect my android app to the localhost running mysql database (as you might be knowing like some webservice). 我是php服务器端和mysql的新手。有了这方面的一些基本知识。最近安装了wamp服务器以及一些php文件和数据库创建,我试图将我的android应用程序连接到运行mysql数据库的本地主机(可能是知道一些网络服务)。

So in the browser i typed http://localhost in the url address space and its shows the wampserver home page 因此,在浏览器中,我在URL地址空间中输入了http://localhost ,它显示了wampserver主页

but when i typed http://localhost/phpmyadmin its shows some error page I am attaching the screenshot for the error page 但是,当我键入http://localhost/phpmyadmin它显示了一些错误页面,我附上了错误页面的屏幕截图

Here is the screen 这是屏幕

phpmyadmin显示错误页面

So anybody can tell me what should I do in order to get the correct phpmyadmin page. 所以任何人都可以告诉我我该怎么做才能获得正确的phpmyadmin页面。 If more info require in this part pls let me know 如果需要更多信息,请告诉我

First stop Mysql: 首先停止Mysql:

Sudo / etc / init.d / mysql stop 须藤/etc/init.d/mysql停止

Then open the configuration file php5 and look for the line that enables entry into Safe Mode: 然后打开配置文件php5并查找允许进入安全模式的行:

Vim / etc/php5/apache2/php.ini Vim / etc / php5 / apache2 / php.ini

Within vim enter the functions mode / safe (to locate the line) and change it to On 在vim中进入功能模式/安全(找到行)并将其更改为On

safe_mode = Onn safe_mode =恩

Exit VIM editor and save the changes: 退出VIM编辑器并保存更改:

Restart the MySQL mode security (safe_mod): 重新启动MySQL模式安全性(safe_mod):

Safe_mysqld-skip-grant-tables & Safe_mysqld跳过授予表和

With MySQL in safe mode select the mysql table and then change the root password and grant all privileges and exit MySQL with the EXIT command. 在MySQL处于安全模式下时,选择mysql表,然后更改root密码并授予所有特权,并使用EXIT命令退出MySQL。

Mysql> USE mysql mysql>使用mysql

mysql> UPDATE user SET password = password ("new_password") WHERE user = "root"; mysql> UPDATE用户SET密码=密码(“ new_password”)WHERE用户=“ root”;

Result: Query OK, 1 row affected (0.00 sec) Rows matched: 3 Changed: 1 Warnings: 0 结果:查询正常,受影响的行有1条(0.00秒)匹配的行:3已更改:1警告:0

mysql> flush privileges; mysql>刷新权限;

Result: Query OK, 0 rows affected (0.00 sec) 结果:查询正常,受影响的0行(0.00秒)

mysql> exit mysql>退出

Now the Linux Shell kill all mysql processes 现在,Linux Shell杀死所有mysql进程

Killall mysqld mysql Killall mysqld mysql

Mysql restart normally. mysql正常重启。

/ etc / init.d / mysql start /etc/init.d/mysql启动

To test access MySQL from the terminal and the browser through PhpMyAdmin Terminal: 要从终端和浏览器通过PhpMyAdmin终端测试访问MySQL,请执行以下操作:

mysql-u root-p mysql -u root -p

http://localhost/phpmyadmin

Enter username and password for root. 输入root用户名和密码。

  1. Make sure you started Your server 确保您启动了服务器
  2. go to server and start it 转到服务器并启动它
  3. then enter localhost/phpmyadmin 然后输入localhost / phpmyadmin
  4. find your database then select you database 找到您的数据库,然后选择您的数据库

You have to allow localhost access to your mysql server. 您必须允许localhost访问您的mysql服务器。 And its basicly the same question as https://superuser.com/questions/603026/mysql-how-to-fix-access-denied-for-user-rootlocalhost 它基本上与https://superuser.com/questions/603026/mysql-how-to-fix-access-denied-for-user-rootlocalhost相同

You will need to reset the password. 您将需要重设密码。

First start the mysql server instance or daemon with the --skip-grant-tables option. 首先使用--skip-grant-tables选项启动mysql服务器实例或守护进程。 (security setting) (安全设置)

Then Execute these statements. 然后执行这些语句。

# mysql -u root mysql 
mysql> UPDATE user SET Password=PASSWORD('your_new_password') where USER='root'; 
mysql> FLUSH PRIVILEGES; 

Finally, restart the instance/daemon without the --skip-grant-tables option. 最后,在没有--skip-grant-tables选项的情况下重新启动实例/守护程序。

You should be able to connect with your new password. 您应该可以使用新密码进行连接。

# mysql -u root -p 
Enter password: your_new_password 

您必须更改用户root的密码,然后修改文件config.inc.php

Make sure that you installed the wamp server directly onto your (C:) drive and not into program files - 确保将wamp服务器直接安装在(C :)驱动器上,而不是安装在程序文件中-

Secondly, you need to actually run the server to access localhost - you can do this by opening up the control panel for the server and starting the APACHE and MYSQL services. 其次,您需要实际运行服务器来访问本地主机-您可以通过打开服务器的控制面板并启动APACHE和MYSQL服务来执行此操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试计算数字是否为回文时出现错误? - I am getting an error while trying to calculate if a number is palaindrome? 尝试检查应用程序的方向时出错? - I am getting error while trying to check orientation of app? 为什么我在尝试更改代码时收到错误消息? - Why am I getting an error message while trying to code for change? 我正在尝试使用休眠xml映射连接到mysql数据库,但出现此错误 - I am trying to connect to a mysql database with hibernate xml mapping but I am getting this error 当我尝试使用 Spring Boot 将产品添加到购物车时出现错误 - I am getting an error while i am trying to add a product to the cart using Spring boot 尝试使用JSP页面连接到MySql时出现错误 - I am getting error when trying to connect to MySql using JSP page 尝试 setOnClickListener 时出现错误 - I am getting error when trying to setOnClickListener 我在尝试更新用户时出错,但无法使用 SpringBoot 显示我的用户角色 - I getting an error while i am trying to update an user and not able to show my users roles using SpringBoot 我正在尝试启动 Mozilla,但仍然收到此错误 - I am trying to launch Mozilla but still I am getting this error 为什么会出现“拒绝访问'localhost'”错误? - Why am I getting an “Access denied to 'localhost'” error?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM