我已将xampp
安装到我的系统中。然后在记事本和httpd.conf
中打开modified server name and server admin
文件,即;我将localhost更改为我的系统IP地址。在config.inc.php中,我将服务器ip '127.0.0.1'
更改为我的系统IP地址。然后我打开XAMPP控制面板,安装Apache和MySql并启动它。我单击Mysql按钮前面的Admin按钮打开数据库。它显示'Host cannot connect to mysql server'
。然后我打开了XAMPP for Windows command prompt
。我有错误
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'mysql
-u root' at line 1
我是否遗漏了任何不允许连接数据库的配置设置?我检查了文档根目录。路径是正确的。我没有得到我出错的地方。
Setting environment for using XAMPP for Windows.
rakshitha@OCEANMLRLP02 c:\xampp
# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.5.36 MySQL Community Server (GPL)
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| test |
+--------------------+
2 rows in set (0.00 sec)
mysql> mysql -u root;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'mysql
-u root' at line 1
答案 0 :(得分:0)
出了什么问题,你已经登录了:)" mysql -u root"是一个登录mysql服务器的命令。 "&MySQL的GT;"提示表明你已经进入,你应该在这里使用MySQL命令,就像你在线上做的那样" mysql>显示数据库;"。