[英]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 这是屏幕
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:
Then open the configuration file php5 and look for the line that enables entry into Safe Mode: 然后打开配置文件php5并查找允许进入安全模式的行:
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):
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进程
Mysql restart normally. mysql正常重启。
To test access MySQL from the terminal and the browser through PhpMyAdmin Terminal: 要从终端和浏览器通过PhpMyAdmin终端测试访问MySQL,请执行以下操作:
http://localhost/phpmyadmin
Enter username and password for root. 输入root用户名和密码。
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.